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