Versions Compared

Key

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

...

Search for vulnerabilities resulting from the violation of this rule on the CERT website.

Related Guidelines

CERT C++ Secure Coding Standard: FLP34-CPP. Ensure that floating point conversions are within range of the new type

Java The CERT Oracle Secure Coding Standard for Java: FLP03-J. Range check before casting floating point numbers to narrower types

Bibliography

unmigrated-wiki-markup

\[[ISO/IEC 9899:1999|AA. Bibliography#ISO/IEC 9899-1999]\] Section 6.3.1.4, "Real floating and integer," and Section 6.3.1.5, "Real floating types" \[[

ISO/IEC PDTR 24772|AA. Bibliography#ISO/IEC PDTR 24772]\] TR 24772 "FLC Numeric Conversion Errors"

MITRE CWE: CWE-681, "Incorrect Conversion between Numeric Types"

Bibliography

Wiki Markup

\[[IEEE 754|AA. Bibliography#IEEE 754 2006]\] IEEE 754-1985 Standard for Binary Floating-Point Arithmetic
\[[MITRE 2007|AA. Bibliography#MITRE 07]\] [CWE ID 681|http://cwe.mitre.org/data/definitions/681.html], "Incorrect Conversion between Numeric Types"

...

FLP33-C. Convert integers to floating point for floating point operations      05. Floating Point (FLP)      FLP35-C. Take granularity into account when comparing floating point values