Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Edited by NavBot (jp)

...

Operating System

How to handle floating point errors

Linux
Solaris 10
AIX 5.3
HP-UX 11.31
Mac OS X 10.5

Use the C99 floating-point exception functions.

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="96a5aca7fba339fb-c6c772ef-4a234043-98c192aa-761ce7b1384f5f0f8d2483ad"><ac:plain-text-body><![CDATA[

Windows

Either use the C99 floating-point exception function or structured exception handling through _fpieee_flt [[MSDN

AA. C References#MSDN]]

]]></ac:plain-text-body></ac:structured-macro>

...

Wiki Markup
\[[IEEE 754|AA. C References#IEEE 754 2006]\]
\[[Intel 01|AA. C References#Intel 01]\]
\[[Keil 08|AA. C References#Keil 08]\]
\[[MITRE 07|AA. C References#MITRE 07]\] [CWE ID 369|http://cwe.mitre.org/data/definitions/369.html], "Divide By Zero"
\[[MSDN|AA. C References#MSDN]\] "[fpieee_flt (CRT)|http://msdn.microsoft.com/en-us/library/te2k2f2t(VS.80).aspx]"
\[[Open Group 04|AA. C References#Open Group 04]\] "[{{fenv.h}} - Floating-point environment|http://www.opengroup.org/onlinepubs/009695399/basedefs/fenv.h.html]"
\[[SecurityFocus 07|AA. C References#SecurityFocus 07]\]

...

FLP02-C. Consider avoiding Avoid using floating point numbers when precise computation is needed      05. Floating Point (FLP)      FLP30-C. Do not use floating point variables as loop counters