nanl Function

Returns a quiet NaN.

Include

<math.h>

Prototype

long double nanl(const char * tagp);

Arguments

tagp
an optional, implementation-defined string which might be used to represent extra information in the NaN’s significand

Return Value

The call nan("n-char-sequence") is equivalent to strtold("NAN(n-char- sequence)", (char**) NULL); the call nan("") is equivalent to strtold("NAN()", (char**) NULL). When tagp does not point to an n-char sequence or an empty string, the equivalent call to strtold would have a first argument of "NAN".

Example

#include <math.h>
#include <stdio.h>

int main(void)
{
  long double x;

  z = nanl(NULL);
  printf("Here is our not-a-number: %Lf\n", z);
}

Example Output

Here is our not-a-number: nan