nanl - C math.h

C examples for math.h:nanl

Type

function

From

<cmath>
<ctgmath>
<math.h>

Description

Returns a quiet NaN (Not-A-Number) value of type long 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.

Prototype

float nanl (const char* tagp);

Parameters

Parameter Description
tagp An implementation-specific C-string.

Return Value

A quiet NaN value.

Demo Code


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

int main()/*w  w  w.ja  v a  2  s.  co m*/
{
    printf("%f\n",nanl(""));
    printf("%f",nanl("NaN"));
    return 0;
}

Related Tutorials