Namespaces
Variants
Views
Actions

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

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

 
 
 
Common mathematical functions
Functions
Basic operations
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
nannanfnanl
(C++11)(C++11)(C++11)
Exponential functions
(C++11)
(C++11)
(C++11)
(C++11)
Power functions
(C++11)
(C++11)
Trigonometric and hyperbolic functions
(C++11)
(C++11)
(C++11)
Error and gamma functions
(C++11)
(C++11)
(C++11)
(C++11)
Nearest integer floating point operations
(C++11)(C++11)(C++11)
(C++11)
(C++11)
(C++11)(C++11)(C++11)
Floating point manipulation functions
(C++11)(C++11)
(C++11)
(C++11)
(C++11)(C++11)
(C++11)
Classification/Comparison
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
Macro constants
(C++11)(C++11)(C++11)(C++11)(C++11)
 

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

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

<td></td> <td></td> <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) [edit]
C documentation for nanf, nan, nanl