logo

oasis-root

Compiled tree of Oasis Linux based on own branch at <https://hacktivis.me/git/oasis/> git clone https://anongit.hacktivis.me/git/oasis-root.git

fetestexcept.3p (2922B)


  1. '\" et
  2. .TH FETESTEXCEPT "3P" 2017 "IEEE/The Open Group" "POSIX Programmer's Manual"
  3. .\"
  4. .SH PROLOG
  5. This manual page is part of the POSIX Programmer's Manual.
  6. The Linux implementation of this interface may differ (consult
  7. the corresponding Linux manual page for details of Linux behavior),
  8. or the interface may not be implemented on Linux.
  9. .\"
  10. .SH NAME
  11. fetestexcept
  12. \(em test floating-point exception flags
  13. .SH SYNOPSIS
  14. .LP
  15. .nf
  16. #include <fenv.h>
  17. .P
  18. int fetestexcept(int \fIexcepts\fP);
  19. .fi
  20. .SH DESCRIPTION
  21. The functionality described on this reference page is aligned with the
  22. ISO\ C standard. Any conflict between the requirements described here and the
  23. ISO\ C standard is unintentional. This volume of POSIX.1\(hy2017 defers to the ISO\ C standard.
  24. .P
  25. The
  26. \fIfetestexcept\fR()
  27. function shall determine which of a specified subset of the
  28. floating-point exception flags are currently set. The
  29. .IR excepts
  30. argument specifies the floating-point status flags to be queried.
  31. .SH "RETURN VALUE"
  32. The
  33. \fIfetestexcept\fR()
  34. function shall return the value of the bitwise-inclusive OR of the
  35. floating-point exception macros corresponding to the currently set
  36. floating-point exceptions included in
  37. .IR excepts .
  38. .SH ERRORS
  39. No errors are defined.
  40. .LP
  41. .IR "The following sections are informative."
  42. .SH EXAMPLES
  43. The following example calls function
  44. \fIf\fR()
  45. if an invalid exception is set, and then function
  46. \fIg\fR()
  47. if an overflow exception is set:
  48. .sp
  49. .RS 4
  50. .nf
  51. #include <fenv.h>
  52. /* ... */
  53. {
  54. #pragma STDC FENV_ACCESS ON
  55. int set_excepts;
  56. feclearexcept(FE_INVALID | FE_OVERFLOW);
  57. // maybe raise exceptions
  58. set_excepts = fetestexcept(FE_INVALID | FE_OVERFLOW);
  59. if (set_excepts & FE_INVALID) f();
  60. if (set_excepts & FE_OVERFLOW) g();
  61. /* ... */
  62. }
  63. .fi
  64. .P
  65. .RE
  66. .SH "APPLICATION USAGE"
  67. None.
  68. .SH RATIONALE
  69. None.
  70. .SH "FUTURE DIRECTIONS"
  71. None.
  72. .SH "SEE ALSO"
  73. .IR "\fIfeclearexcept\fR\^(\|)",
  74. .IR "\fIfegetexceptflag\fR\^(\|)",
  75. .IR "\fIferaiseexcept\fR\^(\|)"
  76. .P
  77. The Base Definitions volume of POSIX.1\(hy2017,
  78. .IR "\fB<fenv.h>\fP"
  79. .\"
  80. .SH COPYRIGHT
  81. Portions of this text are reprinted and reproduced in electronic form
  82. from IEEE Std 1003.1-2017, Standard for Information Technology
  83. -- Portable Operating System Interface (POSIX), The Open Group Base
  84. Specifications Issue 7, 2018 Edition,
  85. Copyright (C) 2018 by the Institute of
  86. Electrical and Electronics Engineers, Inc and The Open Group.
  87. In the event of any discrepancy between this version and the original IEEE and
  88. The Open Group Standard, the original IEEE and The Open Group Standard
  89. is the referee document. The original Standard can be obtained online at
  90. http://www.opengroup.org/unix/online.html .
  91. .PP
  92. Any typographical or formatting errors that appear
  93. in this page are most likely
  94. to have been introduced during the conversion of the source files to
  95. man page format. To report such errors, see
  96. https://www.kernel.org/doc/man-pages/reporting_bugs.html .