Implementation status: to be implemented

Synopsis

#include <fenv.h>

int fegetexceptflag(fexcept_t *flagp, int excepts);
int fesetexceptflag(const fexcept_t *flagp, int excepts);

Description

fegetexceptflag(), fesetexceptflag() - get and set current floating-point flags.

Arguments:

flagp - the object saving the floating-point status flags.
excepts - the floating-point status flags.

The fegetexceptflag() function stores the states of the floating-point status flags indicated by the argument excepts in the object pointed to by the argument flagp.

The fesetexceptflag() function sets the floating-point status flags indicated by the argument excepts to the states stored in the object pointed to by flagp. The value pointed to by flagp has been set by a previous call to fegetexceptflag() whose second argument represented at least those floating-point exceptions represented by the argument excepts. This function does not raise floating-point exceptions, but only sets the state of the flags.

Return value

If the representation was successfully stored, fegetexceptflag() returns zero. Otherwise, it returns -1.
If the excepts argument is zero or if all the specified exceptions were successfully set, fesetexceptflag() returns zero. Otherwise, it returns -1.

Errors

No errors are defined.

Implementation tasks

  • Implement fenv.h.
  • Implement fegetexceptflag.
  • Implement fesetexceptflag.