diff options
Diffstat (limited to 'devdocs/c/numeric%2Ffenv.html')
| -rw-r--r-- | devdocs/c/numeric%2Ffenv.html | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/devdocs/c/numeric%2Ffenv.html b/devdocs/c/numeric%2Ffenv.html new file mode 100644 index 00000000..6cec45e9 --- /dev/null +++ b/devdocs/c/numeric%2Ffenv.html @@ -0,0 +1,52 @@ + <h1 id="firstHeading" class="firstHeading">Floating-point environment</h1> <p>The floating-point environment is the set of floating-point status flags and control modes supported by the implementation. It is thread-local, each thread inherits the initial state of its floating-point environment from the parent thread. Floating-point operations modify the floating-point status flags to indicate abnormal results or auxiliary information. The state of floating-point control modes affects the outcomes of some floating-point operations.</p> +<p>The floating-point environment access and modification is only meaningful when <a href="https://en.cppreference.com/w/cpp/preprocessor/impl" title="cpp/preprocessor/impl"><code> #pragma STDC FENV_ACCESS</code></a> is set to <code>ON</code>. Otherwise the implementation is free to assume that floating-point control modes are always the default ones and that floating-point status flags are never tested or modified. In practice, few current compilers, such as HP aCC, Oracle Studio, and IBM XL, support the <span class="co2">#pragma</span> explicitly, but most compilers allow meaningful access to the floating-point environment anyway.</p> +<h3 id="Types"> Types</h3> <table class="t-dsc-begin"> <tr class="t-dsc-header"> <th colspan="2"> Defined in header <code><fenv.h></code> </th> +</tr> <tr class="t-dsc"> <td> <code>fenv_t</code> </td> <td> The type representing the entire floating-point environment </td> +</tr> <tr class="t-dsc"> <td> <code>fexcept_t</code> </td> <td> The type representing all floating-point status flags collectively </td> +</tr> </table> <h3 id="Functions"> Functions</h3> <table class="t-dsc-begin"> <tr class="t-dsc"> <td> <div><a href="fenv/feclearexcept" title="c/numeric/fenv/feclearexcept"> <span class="t-lines"><span>feclearexcept</span></span></a></div> +<div><span class="t-lines"><span><span class="t-mark-rev t-since-c99">(C99)</span></span></span></div> </td> <td> clears the specified floating-point status flags <br> <span class="t-mark">(function)</span> </td> +</tr> <tr class="t-dsc"> <td> <div><a href="fenv/fetestexcept" title="c/numeric/fenv/fetestexcept"> <span class="t-lines"><span>fetestexcept</span></span></a></div> +<div><span class="t-lines"><span><span class="t-mark-rev t-since-c99">(C99)</span></span></span></div> </td> <td> determines which of the specified floating-point status flags are set <br> <span class="t-mark">(function)</span> </td> +</tr> <tr class="t-dsc"> <td> <div><a href="fenv/feraiseexcept" title="c/numeric/fenv/feraiseexcept"> <span class="t-lines"><span>feraiseexcept</span></span></a></div> +<div><span class="t-lines"><span><span class="t-mark-rev t-since-c99">(C99)</span></span></span></div> </td> <td> raises the specified floating-point exceptions <br> <span class="t-mark">(function)</span> </td> +</tr> <tr class="t-dsc"> <td> <div><a href="fenv/feexceptflag" title="c/numeric/fenv/feexceptflag"> <span class="t-lines"><span>fegetexceptflag</span><span>fesetexceptflag</span></span></a></div> +<div><span class="t-lines"><span><span class="t-mark-rev t-since-c99">(C99)</span></span><span><span class="t-mark-rev t-since-c99">(C99)</span></span></span></div> </td> <td> copies the state of the specified floating-point status flags from or to the floating-point environment <br> <span class="t-mark">(function)</span> </td> +</tr> <tr class="t-dsc"> <td> <div><a href="fenv/feround" title="c/numeric/fenv/feround"> <span class="t-lines"><span>fegetround</span><span>fesetround</span></span></a></div> +<div><span class="t-lines"><span><span class="t-mark-rev t-since-c99">(C99)</span></span><span><span class="t-mark-rev t-since-c99">(C99)</span></span></span></div> </td> <td> gets or sets rounding direction <br> <span class="t-mark">(function)</span> </td> +</tr> <tr class="t-dsc"> <td> <div><a href="fenv/feenv" title="c/numeric/fenv/feenv"> <span class="t-lines"><span>fegetenv</span><span>fesetenv</span></span></a></div> +<div><span class="t-lines"><span><span class="t-mark-rev t-since-c99">(C99)</span></span></span></div> </td> <td> saves or restores the current floating-point environment <br> <span class="t-mark">(function)</span> </td> +</tr> <tr class="t-dsc"> <td> <div><a href="fenv/feholdexcept" title="c/numeric/fenv/feholdexcept"> <span class="t-lines"><span>feholdexcept</span></span></a></div> +<div><span class="t-lines"><span><span class="t-mark-rev t-since-c99">(C99)</span></span></span></div> </td> <td> saves the environment, clears all status flags and ignores all future errors <br> <span class="t-mark">(function)</span> </td> +</tr> <tr class="t-dsc"> <td> <div><a href="fenv/feupdateenv" title="c/numeric/fenv/feupdateenv"> <span class="t-lines"><span>feupdateenv</span></span></a></div> +<div><span class="t-lines"><span><span class="t-mark-rev t-since-c99">(C99)</span></span></span></div> </td> <td> restores the floating-point environment and raises the previously raise exceptions <br> <span class="t-mark">(function)</span> </td> +</tr> </table> <h3 id="Macros"> Macros</h3> <table class="t-dsc-begin"> <tr class="t-dsc"> <td> <div><a href="fenv/fe_exceptions" title="c/numeric/fenv/FE exceptions"> <span class="t-lines"><span>FE_ALL_EXCEPT</span><span>FE_DIVBYZERO</span><span>FE_INEXACT</span><span>FE_INVALID</span><span>FE_OVERFLOW</span><span>FE_UNDERFLOW</span></span></a></div> +<div><span class="t-lines"><span><span class="t-mark-rev t-since-c99">(C99)</span></span></span></div> </td> <td> floating-point exceptions <br> <span class="t-mark">(macro constant)</span> </td> +</tr> <tr class="t-dsc"> <td> <div><a href="fenv/fe_round" title="c/numeric/fenv/FE round"> <span class="t-lines"><span>FE_DOWNWARD</span><span>FE_TONEAREST</span><span>FE_TOWARDZERO</span><span>FE_UPWARD</span></span></a></div> +<div><span class="t-lines"><span><span class="t-mark-rev t-since-c99">(C99)</span></span></span></div> </td> <td> floating-point rounding direction <br> <span class="t-mark">(macro constant)</span> </td> +</tr> <tr class="t-dsc"> <td> <div><a href="fenv/fe_dfl_env" title="c/numeric/fenv/FE DFL ENV"> <span class="t-lines"><span>FE_DFL_ENV</span></span></a></div> +<div><span class="t-lines"><span><span class="t-mark-rev t-since-c99">(C99)</span></span></span></div> </td> <td> default floating-point environment <br> <span class="t-mark">(macro constant)</span> </td> +</tr> </table> <h3 id="References"> References</h3> <ul> +<li> C23 standard (ISO/IEC 9899:2023): </li> +<ul> +<li> 7.6 Floating-point environment <fenv.h> (p: TBD) </li> +<li> 7.31.4 Floating-point environment <fenv.h> (p: TBD) </li> +</ul> +<li> C17 standard (ISO/IEC 9899:2018): </li> +<ul> +<li> 7.6 Floating-point environment <fenv.h> (p: 150-156) </li> +<li> 7.31.4 Floating-point environment <fenv.h> (p: 332) </li> +</ul> +<li> C11 standard (ISO/IEC 9899:2011): </li> +<ul> +<li> 7.6 Floating-point environment <fenv.h> (p: 206-215) </li> +<li> 7.31.4 Floating-point environment <fenv.h> (p: 455) </li> +</ul> +<li> C99 standard (ISO/IEC 9899:1999): </li> +<ul><li> 7.6 Floating-point environment <fenv.h> (p: 187-196) </li></ul> +</ul> <h3 id="See_also"> See also</h3> <table class="t-dsc-begin"> <tr class="t-dsc"> <td colspan="2"> <span><a href="https://en.cppreference.com/w/cpp/numeric/fenv" title="cpp/numeric/fenv">C++ documentation</a></span> for <code>Floating-point environment</code> </td> +</tr> </table> <div class="_attribution"> + <p class="_attribution-p"> + © cppreference.com<br>Licensed under the Creative Commons Attribution-ShareAlike Unported License v3.0.<br> + <a href="https://en.cppreference.com/w/c/numeric/fenv" class="_attribution-link">https://en.cppreference.com/w/c/numeric/fenv</a> + </p> +</div> |
