[Cfp-interest 1256] fegetexceptflag()

Fred J. Tydeman tydeman at tybor.com
Tue Feb 12 09:20:52 PST 2019


Does
 #include <fenv.h>
 fexcept_t flagp;
  fegetexceptflag( &flagp, 0 );
store anything?  Since the 2nd argument is 0, nothing is being asked for.
Does the function still return 0 (to indicate success)?

If nothing was stored, is
  fegetexceptflag( NULL, 0 );
valid?


>From C2X:

Synopsis
#include <fenv.h>
int fegetexceptflag(fexcept_t *flagp,
int excepts);

Description
The fegetexceptflag function attempts to store an implementation-defined representation of the
states of the floating-point status flags indicated by the argument excepts in the object pointed to
by the argument flagp.

Returns
The fegetexceptflag function returns zero if the representation was successfully stored. Otherwise,
it returns a nonzero value.


---
Fred J. Tydeman        Tydeman Consulting
tydeman at tybor.com      Testing, numerics, programming
+1 (702) 608-6093      Vice-chair of PL22.11 (ANSI "C")
Sample C99+FPCE tests: http://www.tybor.com
Savers sleep well, investors eat well, spenders work forever.



More information about the Cfp-interest mailing list