29 Numerics library [numerics]

29.3 The floating-point environment [cfenv]

29.3.1 Header <cfenv> synopsis [cfenv.syn]

#define FE_ALL_EXCEPT see below #define FE_DIVBYZERO see below / optional #define FE_INEXACT see below / optional #define FE_INVALID see below / optional #define FE_OVERFLOW see below / optional #define FE_UNDERFLOW see below / optional #define FE_DOWNWARD see below / optional #define FE_TONEAREST see below / optional #define FE_TOWARDZERO see below / optional #define FE_UPWARD see below / optional #define FE_DFL_ENV see below namespace std { / types using fenv_t = object type; using fexcept_t = object type; / functions int feclearexcept(int except); int fegetexceptflag(fexcept_t* pflag, int except); int feraiseexcept(int except); int fesetexceptflag(const fexcept_t* pflag, int except); int fetestexcept(int except); int fegetround(); int fesetround(int mode); int fegetenv(fenv_t* penv); int feholdexcept(fenv_t* penv); int fesetenv(const fenv_t* penv); int feupdateenv(const fenv_t* penv); }
The contents and meaning of the header <cfenv> are a subset of the C standard library header <fenv.h> and only the declarations shown in the synopsis above are present.
[Note 1: 
This document does not require an implementation to support the FENV_ACCESS pragma; it is implementation-defined ([cpp.pragma]) whether the pragma is supported.
As a consequence, it is implementation-defined whether these functions can be used to test floating-point status flags, set floating-point control modes, or run under non-default mode settings.
If the pragma is used to enable control over the floating-point environment, this document does not specify the effect on floating-point evaluation in constant expressions.
— end note]
See also: ISO/IEC 9899:2024, 7.6

Follow Lee on X/Twitter - Father, Husband, Serial builder creating AI, crypto, games & web tools. We are friends :) AI Will Come To Life!

Check out: eBank.nz (Art Generator) | Netwrck.com (AI Tools) | Text-Generator.io (AI API) | BitBank.nz (Crypto AI) | ReadingTime (Kids Reading) | RewordGame | BigMultiplayerChess | WebFiddle | How.nz | Helix AI Assistant