Namespaces
Variants
Views
Actions

std::nan, std::nanf, std::nanl

From cppreference.com
< cpp‎ | numeric‎ | math
Revision as of 20:02, 2 March 2013 by 74.104.151.109 (Talk)

 
 
 
 

Template:ddcl list begin <tr class="t-dsc-header">

<td>
Defined in header <cmath>
</td>

<td></td> <td></td> </tr> <tr class="t-dcl ">

<td >
float nanf( const char* arg );
</td>

<td class="t-dcl-nopad"> </td> <td > (since C++11) </td> </tr> <tr class="t-dcl ">

<td >
double nan( const char* arg );
</td>

<td class="t-dcl-nopad"> </td> <td > (since C++11) </td> </tr> <tr class="t-dcl ">

<td >
long double nanl( const char* arg );
</td>

<td class="t-dcl-nopad"> </td> <td > (since C++11) </td> </tr> Template:ddcl list end

Converts the implementation-defined character string arg into the corresponding quiet NaN value. The call std::nan("string") is equivalent to the call std::strtod("NAN(string)", (char**)NULL);.

Parameters

arg - narrow character string identifying the contents of a NaN, or an empty string

Return value

The NaN value that corresponds to the identifying string arg or zero if the implementation does not support quiet NaNs.

See also

Template:cpp/numeric/math/dcl list isnan
[static]
returns a quiet NaN value of the given floating-point type
(public static member function of std::numeric_limits<T>) [edit]
C documentation for nanf, nan, nanl