Keil™, An ARM® Company

CARM User's Guide

Discontinued

double Errors

The CARM Compiler detects floating-point errors and reports them by setting the double value to one of several special binary values. Your software must appropriately respond to floating-point error conditions.

The floating-point error values are defined as a part of the IEEE standard and are used whenever an error occurs during normal processing of floating-point operations. Your code should check for possible arithmetic errors at the end of each floating-point operation.

NameValueMeaning
NaN0xFFFFFFFF FFFFFFFFNot a Number
+INF0x7FF00000 00000000Positive Infinity (positive overflow)
-INF0xFFF00000 00000000Negative Infinity (negative overflow)
ZERO0x00000000 00000000Zero Value

The CARM library function _chkdouble_ allows you to quickly check the floating-point status of double numbers.

Note

  • Not a number (NaN) is represented by setting the exponent to the highest positive value and the mantissa to a non-zero value. The value of the sign bit is ignored.
  • Infinity (+INF or -INF) is represented by setting the exponent to the highest value and the mantissa to zero. The sign bit signifies positive or negative infinity.
  • Zero is represented by a zero sign, mantissa, and exponent.