[ Bottom of Page | Previous Page | Next Page | Contents | Index | Library Home | Legal | Search ]

Technical Reference: Base Operating System and Extensions, Volume 1

nan, nanf, or nanl Subroutine

Purpose

Returns quiet NaN.

Syntax

#include <math.h>

double nan (tagp)
const char *tagp;

float nanf (tagp)
const char *tagp;

long double nanl (tagp)
const char *tagp;

Description

The function call nan("n-char-sequence") is equivalent to:

strtod("NAN(n-char-sequence)", (char **) NULL);

The function call nan(" ") is equivalent to:

strtod("NAN()", (char **) NULL)

If tagp does not point to an n-char sequence or an empty string, the function call is equivalent to:

strtod("NAN", (char **) NULL)

Function calls to nanf and nanl are equivalent to the corresponding function calls to strtof and strtold.

Parameters

tagp Indicates the content of the quiet NaN.

Return Values

The nan, nanf, and nanl subroutines return a quiet NaN with content indicated through tagp.

Related Information

The atof atoff Subroutine.

math.h in AIX 5L Version 5.2 Files Reference.

[ Top of Page | Previous Page | Next Page | Contents | Index | Library Home | Legal | Search ]