...
Wiki Markup |
---|
The most portable way of determining if a floating-point exceptional condition has occurred is to use the floating-point exception facilities provided by C99 in {{fenv.h}} \[[ISO/IEC 9899:1999|AA. References#ISOBibliography#ISO/IEC 9899-1999]\]. |
However, the C99 floating-point exception functions are not without problems. The following caveats exist regarding the interaction between floating-point exceptions and conversions:
...
Operating System | How to handle floating point errors | |||
---|---|---|---|---|
Linux | Use the C99 floating-point exception functions. | |||
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="a5cb258f8f7bd9a5-365efefb-48e74576-bac2934b-8a7a8ba10d7ab2953ed7ce3a"><ac:plain-text-body><![CDATA[ | Windows | Either use the C99 floating-point exception function or structured exception handling through | AA. References#MSDNBibliography#MSDN]] | ]]></ac:plain-text-body></ac:structured-macro> |
...
Wiki Markup |
---|
\[[IEEE 754|AA. References#IEEEBibliography#IEEE 754 2006]\] \[[Intel 01|AA. References#IntelBibliography#Intel 01]\] \[[Keil 08|AA. References#KeilBibliography#Keil 08]\] \[[MITRE 07|AA. References#MITREBibliography#MITRE 07]\] [CWE ID 369|http://cwe.mitre.org/data/definitions/369.html], "Divide By Zero" \[[MSDN|AA. References#MSDNBibliography#MSDN]\] "[fpieee_flt (CRT)|http://msdn.microsoft.com/en-us/library/te2k2f2t(VS.80).aspx]" \[[Open Group 04|AA. References#OpenBibliography#Open Group 04]\] "[{{fenv.h}} - Floating-point environment|http://www.opengroup.org/onlinepubs/009695399/basedefs/fenv.h.html]" \[[SecurityFocus 07|AA. References#SecurityFocusBibliography#SecurityFocus 07]\] |
...
FLP02-C. Avoid using floating point numbers when precise computation is needed 05. Floating Point (FLP) FLP04-C. Check floating point inputs for exceptional values