feclearexcept,  fegetexceptflag,  feraiseexcept,  fesetex­
       ceptflag, fetestexcept,  fegetenv,  fegetround,  feholdex­
       cept,  fesetround,  fesetenv,  feupdateenv  - C99 floating
       point rounding and exception handling


SYNOPSIS

       #include <fenv.h>

       void feclearexcept(int excepts);
       void fegetexceptflag(fexcept_t *flagp, int excepts);
       void feraiseexcept(int excepts);
       void fesetexceptflag(const fexcept_t *flagp, int excepts);
       int fetestexcept(int excepts);

       int fegetround(void);
       int fesetround(int rounding_mode);

       void fegetenv(fenv_t *envp);
       int feholdexcept(fenv_t *envp);
       void fesetenv(const fenv_t *envp);
       void feupdateenv(const fenv_t *envp);


DESCRIPTION

       These eleven functions were defined in C99,  and  describe
       the  handling  of  floating  point rounding and exceptions
       (overflow, zero-divide etc.).

   Exception handling
       Exceptions are represented in two ways: as  a  single  bit
       (exception  present/absent),  and these bits correspond in
       some implementation-defined way with bit positions  in  an
       integer,  and also as an opaque structure that may contain
       more information about the  exception  (perhaps  the  code
       address where it occurred).

       Each  of  the macros FE_DIVBYZERO, FE_INEXACT, FE_INVALID,
       FE_OVERFLOW, FE_UNDERFLOW is defined when the  implementa­
       tion supports handling of the corresponding exception, and
       if so then define the corresponding bit(s),  so  that  one
       can call exception handling functions e.g. using the inte­
       ger argument FE_OVERFLOW|FE_UNDERFLOW.   Other  exceptions
       may  be  supported. The macro FE_ALL_EXCEPT is the bitwise
       OR of all bits corresponding to supported exceptions.

       The feclearexcept function clears the supported exceptions
       represented by the bits in its argument.

       The  fegetexceptflag  function  stores a representation of
       the exception flags represented by the argument excepts in
       the opaque object pointed to by flagp.

       The feraiseexcept function raises the supported exceptions
       the exceptions represented by excepts to the value pointed
       to by flagp.  This value must have  been  obtained  by  an
       earlier  call of fegetexceptflag with a last argument that
       contained all bits in excepts.

       The fetestexcept function returns a word in which the bits
       are  set  that  were  set  in the argument excepts and for
       which the corresponding exception is currently set.

   Rounding
       Each   of   the    macros    FE_DOWNWARD,    FE_TONEAREST,
       FE_TOWARDZERO,  FE_UPWARD  is defined when the implementa­
       tion supports getting and setting the corresponding round­
       ing direction.

       The fegetround function returns the macro corresponding to
       the current rounding mode.

       The fesetround function sets the rounding mode  as  speci­
       fied by its argument and returns zero when it was success­
       ful.

   Floating point environment
       The entire floating point environment,  including  control
       modes  and  status  flags,  can  be  handled as one opaque
       object, of type  fenv_t  .   The  default  environment  is
       denoted by FE_DFL_ENV (of type const fenv_t *).

       The  fegetenv  function  saves  the current floating point
       environment in the object pointed to by envp.

       The feholdexcept function does the same, then  clears  all
       exception  flags,  and sets a non-stop (continue on excep­
       tions) mode, if available. It returns zero  when  success­
       ful.

       The fesetenv function restores the floating point environ­
       ment from the object pointed to by envp.  This object must
       be  known  to  be  valid,  e.g.,  the  result of a call to
       fegetenv or feholdexcept or  equal  to  FE_DFL_ENV.   This
       call does not raise exceptions.

       The feupdateenv function saves the currently raised excep­
       tions in its automatic  storage,  installs  the  floating-
       point  environment represented by the object pointed to by
       envp, and then raises the saved  exceptions.   As  before,
       the object pointed to by envp must be known to be valid.