In ARM Compiler 4.1 and later, the error handling of mathematical functions is consistent with Annex F of the ISO/IEC C99 standard. In RVCT 4.0 and earlier, it is not.
To invoke RVCT 4.0 and earlier behavior, you can define
__use_rvct_matherr. Table 10 shows how the
math functions respond when supplied with out-of-range arguments.
|Function||Condition||Returned value||Error number|
HUGE_VAL is an alias for
errno variable for the error number.
Other than the cases shown in Table 10, all functions return
QNaN and throw an invalid operation exception
The string passed to C99
nan() is ignored,
and the same Not a Number (NaN) is always returned, namely
the one with all fraction bits clear except the topmost one. The
sign bit is also clear. Passing strings of the form
the same effect.
- Other info
WG14/N1256 Committee Draft, ISO/IEC 9899:TC3, September 7, 2007.