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="b789b291b15e4e69-b160dfa8-42cc4a86-a8339aa6-2fcf35ee3c0de61b27698218"><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="47475e0c966ba5a4-cfc1d651-40544228-9c8ba463-491331f3a3466a4c357e555b"><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