diff options
| author | Craig Jennings <c@cjennings.net> | 2025-08-14 22:58:58 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2025-08-14 22:58:58 -0500 |
| commit | 82ba818ff456bcd6d56a06226e3f27e98fbb55c3 (patch) | |
| tree | 158cfc17b2f644a10f063cb546752cfaae12c97f /devdocs/c/numeric%2Ffenv%2Ffe_exceptions.html | |
| parent | 9278ddd4ea1a8b1a4c1edaa8894516e3f48d245b (diff) | |
| download | dotemacs-82ba818ff456bcd6d56a06226e3f27e98fbb55c3.tar.gz dotemacs-82ba818ff456bcd6d56a06226e3f27e98fbb55c3.zip | |
removing all downloaded devdocs files
Diffstat (limited to 'devdocs/c/numeric%2Ffenv%2Ffe_exceptions.html')
| -rw-r--r-- | devdocs/c/numeric%2Ffenv%2Ffe_exceptions.html | 87 |
1 files changed, 0 insertions, 87 deletions
diff --git a/devdocs/c/numeric%2Ffenv%2Ffe_exceptions.html b/devdocs/c/numeric%2Ffenv%2Ffe_exceptions.html deleted file mode 100644 index aa31da7a..00000000 --- a/devdocs/c/numeric%2Ffenv%2Ffe_exceptions.html +++ /dev/null @@ -1,87 +0,0 @@ - <h1 id="firstHeading" class="firstHeading"><small>FE_DIVBYZERO, FE_INEXACT, FE_INVALID, FE_OVERFLOW, FE_UNDERFLOW, FE_ALL_EXCEPT</small></h1> <table class="t-dcl-begin"> <tr class="t-dsc-header"> <th> Defined in header <code><fenv.h></code> </th> <th> </th> <th> </th> </tr> <tr class="t-dcl t-since-c99"> <td> <pre data-language="c">#define FE_DIVBYZERO /*implementation defined power of 2*/</pre> -</td> <td class="t-dcl-nopad"> </td> <td> <span class="t-mark-rev t-since-c99">(since C99)</span> </td> </tr> <tr class="t-dcl t-since-c99"> <td> <pre data-language="c">#define FE_INEXACT /*implementation defined power of 2*/</pre> -</td> <td class="t-dcl-nopad"> </td> <td> <span class="t-mark-rev t-since-c99">(since C99)</span> </td> </tr> <tr class="t-dcl t-since-c99"> <td> <pre data-language="c">#define FE_INVALID /*implementation defined power of 2*/</pre> -</td> <td class="t-dcl-nopad"> </td> <td> <span class="t-mark-rev t-since-c99">(since C99)</span> </td> </tr> <tr class="t-dcl t-since-c99"> <td> <pre data-language="c">#define FE_OVERFLOW /*implementation defined power of 2*/</pre> -</td> <td class="t-dcl-nopad"> </td> <td> <span class="t-mark-rev t-since-c99">(since C99)</span> </td> </tr> <tr class="t-dcl t-since-c99"> <td> <pre data-language="c">#define FE_UNDERFLOW /*implementation defined power of 2*/</pre> -</td> <td class="t-dcl-nopad"> </td> <td> <span class="t-mark-rev t-since-c99">(since C99)</span> </td> </tr> <tr class="t-dcl t-since-c99"> <td> <pre data-language="c">#define FE_ALL_EXCEPT FE_DIVBYZERO | FE_INEXACT | \ - FE_INVALID | FE_OVERFLOW | \ - FE_UNDERFLOW</pre> -</td> <td class="t-dcl-nopad"> </td> <td> <span class="t-mark-rev t-since-c99">(since C99)</span> </td> </tr> </table> <p>All these macro constants (except <code>FE_ALL_EXCEPT</code>) expand to integer constant expressions that are distinct powers of 2, which uniquely identify all supported floating-point exceptions. Each macro is only defined if it is supported.</p> -<p>The macro constant <code>FE_ALL_EXCEPT</code>, which expands to the bitwise OR of all other <code>FE_*</code>, is always defined and is zero if floating-point exceptions are not supported by the implementation.</p> -<table class="t-dsc-begin"> <tr class="t-dsc-hitem"> <th> Constant </th> <th> Explanation </th> -</tr> <tr class="t-dsc"> <td> <code>FE_DIVBYZERO</code> </td> <td> pole error occurred in an earlier floating-point operation </td> -</tr> <tr class="t-dsc"> <td> <code>FE_INEXACT</code> </td> <td> inexact result: rounding was necessary to store the result of an earlier floating-point operation </td> -</tr> <tr class="t-dsc"> <td> <code>FE_INVALID</code> </td> <td> domain error occurred in an earlier floating-point operation </td> -</tr> <tr class="t-dsc"> <td> <code>FE_OVERFLOW</code> </td> <td> the result of an earlier floating-point operation was too large to be representable </td> -</tr> <tr class="t-dsc"> <td> <code>FE_UNDERFLOW</code> </td> <td> the result of an earlier floating-point operation was subnormal with a loss of precision </td> -</tr> <tr class="t-dsc"> <td> <code>FE_ALL_EXCEPT</code> </td> <td> bitwise OR of all supported floating-point exceptions </td> -</tr> </table> <p>The implementation may define additional macro constants in <code><fenv.h></code> to identify additional floating-point exceptions. All such constants begin with <code>FE_</code> followed by at least one uppercase letter.</p> -<p>See <a href="../math/math_errhandling" title="c/numeric/math/math errhandling">math_errhandling</a> for further details.</p> -<h3 id="Example"> Example</h3> <div class="t-example"> <div class="c source-c"><pre data-language="c">#include <stdio.h> -#include <math.h> -#include <float.h> -#include <fenv.h> - -#pragma STDC FENV_ACCESS ON -void show_fe_exceptions(void) -{ - printf("exceptions raised:"); - if(fetestexcept(FE_DIVBYZERO)) printf(" FE_DIVBYZERO"); - if(fetestexcept(FE_INEXACT)) printf(" FE_INEXACT"); - if(fetestexcept(FE_INVALID)) printf(" FE_INVALID"); - if(fetestexcept(FE_OVERFLOW)) printf(" FE_OVERFLOW"); - if(fetestexcept(FE_UNDERFLOW)) printf(" FE_UNDERFLOW"); - feclearexcept(FE_ALL_EXCEPT); - printf("\n"); -} - -int main(void) -{ - printf("MATH_ERREXCEPT is %s\n", - math_errhandling & MATH_ERREXCEPT ? "set" : "not set"); - - printf("0.0/0.0 = %f\n", 0.0/0.0); - show_fe_exceptions(); - - printf("1.0/0.0 = %f\n", 1.0/0.0); - show_fe_exceptions(); - - printf("1.0/10.0 = %f\n", 1.0/10.0); - show_fe_exceptions(); - - printf("sqrt(-1) = %f\n", sqrt(-1)); - show_fe_exceptions(); - - printf("DBL_MAX*2.0 = %f\n", DBL_MAX*2.0); - show_fe_exceptions(); - - printf("nextafter(DBL_MIN/pow(2.0,52),0.0) = %.1f\n", - nextafter(DBL_MIN/pow(2.0,52),0.0)); - show_fe_exceptions(); -}</pre></div> <p>Possible output:</p> -<div class="text source-text"><pre data-language="c">MATH_ERREXCEPT is set -0.0/0.0 = nan -exceptions raised: FE_INVALID -1.0/0.0 = inf -exceptions raised: FE_DIVBYZERO -1.0/10.0 = 0.100000 -exceptions raised: FE_INEXACT -sqrt(-1) = -nan -exceptions raised: FE_INVALID -DBL_MAX*2.0 = inf -exceptions raised: FE_INEXACT FE_OVERFLOW -nextafter(DBL_MIN/pow(2.0,52),0.0) = 0.0 -exceptions raised: FE_INEXACT FE_UNDERFLOW</pre></div> </div> <h3 id="References"> References</h3> <ul> -<li> C11 standard (ISO/IEC 9899:2011): </li> -<ul><li> 7.6/6 Floating-point environment <fenv.h> (p: 207) </li></ul> -<li> C99 standard (ISO/IEC 9899:1999): </li> -<ul><li> 7.6/5 Floating-point environment <fenv.h> (p: 188) </li></ul> -</ul> <h3 id="See_also"> See also</h3> <table class="t-dsc-begin"> <tr class="t-dsc"> <td> <div><a href="../math/math_errhandling" title="c/numeric/math/math errhandling"> <span class="t-lines"><span>math_errhandling</span><span>MATH_ERRNO</span><span>MATH_ERREXCEPT</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><span class="t-mark-rev t-since-c99">(C99)</span></span></span></div> </td> <td> defines the error handling mechanism used by the common mathematical functions <br> <span class="t-mark">(macro constant)</span> </td> -</tr> <tr class="t-dsc"> <td colspan="2"> <span><a href="https://en.cppreference.com/w/cpp/numeric/fenv/FE_exceptions" title="cpp/numeric/fenv/FE exceptions">C++ documentation</a></span> for <span class=""><span>floating-point exception macros</span></span> </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/FE_exceptions" class="_attribution-link">https://en.cppreference.com/w/c/numeric/fenv/FE_exceptions</a> - </p> -</div> |
