C examples for math.h:nanf
function
<cmath> <ctgmath> <math.h>
Returns a quiet NaN (Not-A-Number) value of type float.
The NaN values identifies undefined values for floating-point elements, such as the square root of negative numbers or the result of 0/0.
float nanf (const char* tagp);
Parameter | Description |
---|---|
tagp | An implementation-specific C-string. |
A quiet NaN value.
#include <stdio.h> #include <math.h> int main()/*from w ww . j a va 2 s .c om*/ { printf("%f\n",nanf("")); printf("%f",nanf("NaN")); return 0; }