WORK IN PROGRESS

Floating Point Numbers, Infinities and NaNs

In preparation for resolving STDCXX-51 this page outlines the platform-specific details describing infinities and NaNs produced as the result of certain floating point calculations, usually triggered by invalid operands.

libc symbols

-4- The macro INFINITY expands to a constant expression of type float representing positive or unsigned infinity, if available; else to a positive constant of type float that overflows at translation time.

-5- The macro NAN is defined if and only if the implementation supports quiet NaNs for the float type. It expands to a constant expression of type float representing a quiet NaN.

-2- The call nan("n-char-sequence") is equivalent to strtod("NAN(n-charsequence)", (char**) NULL); the call nan("") is equivalent to strtod("NAN()", (char**) NULL). If tagp does not point to an n-char sequence or an empty string, the call is equivalent to strtod("NAN", (char**) NULL). Calls to nanf and nanl are equivalent to the corresponding calls to strtof and strtold.

Returns

-3- The nan functions return a quiet NaN, if available, with content indicated through tagp. If the implementation does not support quiet NaNs, the functions return zero.

The table below lists the public symbols defined on each platform for Infinity, quiet NaN, and signaling NaN.