1FETESTEXCEPT(3P) POSIX Programmer's Manual FETESTEXCEPT(3P)
2
3
4
6 This manual page is part of the POSIX Programmer's Manual. The Linux
7 implementation of this interface may differ (consult the corresponding
8 Linux manual page for details of Linux behavior), or the interface may
9 not be implemented on Linux.
10
12 fetestexcept - test floating-point exception flags
13
15 #include <fenv.h>
16
17 int fetestexcept(int excepts);
18
19
21 The fetestexcept() function shall determine which of a specified subset
22 of the floating-point exception flags are currently set. The excepts
23 argument specifies the floating-point status flags to be queried.
24
26 The fetestexcept() function shall return the value of the bitwise-
27 inclusive OR of the floating-point exception macros corresponding to
28 the currently set floating-point exceptions included in excepts.
29
31 No errors are defined.
32
33 The following sections are informative.
34
36 The following example calls function f() if an invalid exception is
37 set, and then function g() if an overflow exception is set:
38
39
40 #include <fenv.h>
41 /* ... */
42 {
43 #pragma STDC FENV_ACCESS ON
44 int set_excepts;
45 feclearexcept(FE_INVALID | FE_OVERFLOW);
46 // maybe raise exceptions
47 set_excepts = fetestexcept(FE_INVALID | FE_OVERFLOW);
48 if (set_excepts & FE_INVALID) f();
49 if (set_excepts & FE_OVERFLOW) g();
50 /* ... */
51 }
52
54 None.
55
57 None.
58
60 None.
61
63 feclearexcept(), fegetexceptflag(), feraiseexcept(), the Base Definiā
64 tions volume of IEEE Std 1003.1-2001, <fenv.h>
65
67 Portions of this text are reprinted and reproduced in electronic form
68 from IEEE Std 1003.1, 2003 Edition, Standard for Information Technology
69 -- Portable Operating System Interface (POSIX), The Open Group Base
70 Specifications Issue 6, Copyright (C) 2001-2003 by the Institute of
71 Electrical and Electronics Engineers, Inc and The Open Group. In the
72 event of any discrepancy between this version and the original IEEE and
73 The Open Group Standard, the original IEEE and The Open Group Standard
74 is the referee document. The original Standard can be obtained online
75 at http://www.opengroup.org/unix/online.html .
76
77
78
79IEEE/The Open Group 2003 FETESTEXCEPT(3P)