Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Operating System

Handling FP errors

Linux
Solaris 10
Mac OS X 10.5
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="f30c695ccd674d12-99f180bc-440f4c95-be10ad21-aefa7ff4253d49f1f9c1773e"><ac:plain-text-body><![CDATA[Fedora Core 5

C99 FP functions - These functions are declared in fenv.h [2]
]]></ac:plain-text-body></ac:structured-macro>
Before fenv.h based functions were standardized; an alternative to using these C99/fenv() function is using ieee_flags and ieee_handler

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="c8084ba6e0c3434b-847a5567-487149e1-a233a78c-ea51228384d4ee93ad32af6b"><ac:plain-text-body><![CDATA[

Windows

Structured Exception Handling - user defined handler _fpieee_flt [3]
]]></ac:plain-text-body></ac:structured-macro>
 

...

Code Block
bgColor#ccccff
fpOper_usingStatus() {
  /* ... */
  double a = 1e-40, b, c;
  float x = 0, y;
  unsigned int rv = _clearfp() ;

  /* Store into y is inexact and underflows: */
  y = a;   
  rv = _clearfp() ;  /* rv has _SW_INEXACT and _SW_UNDERFLOW */

  /* zero-divide */
  b = y / x; rv = _clearfp() ; /* rv has _SW_ZERODIVIDE */

  /* inexact */
  c = sin(30) * a; rv = _clearfp() ; /* rv has _SW_INEXACT */
  /* ... */
}

...

Wiki Markup
\[6\] ARM support for floating-point computations
[http://www.keil.com/support/man/docs/armlib/armlib_bihbjiea.htm]\\

...

FLP02-A. Understand the caveats of floating point exceptions      05. Floating Point (FLP)       FLP30-C. Do not use floating point variables as loop counters