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

From cppreference.com
< cpp‎ | numeric‎ | math
 
 
 
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)
 
Defined in header <cmath>
float       nanf( const char* arg );
(since C++11)
double      nan( const char* arg );
(since C++11)
long double nanl( const char* arg );
(since C++11)

Converts the implementation-defined character string arg into the corresponding quiet NaN value, as if by calling std::strtod, std::strtof, or std::strtold, respectively, as follows:

The call std::nan("string") is equivalent to the call std::strtod("NAN(string)", (char**)nullptr);.

The call std::nan("") is equivalent to the call std::strtod("NAN()", (char**)nullptr);.

The call std::nan(nullptr) is equivalent to the call std::strtod("NAN", (char**)nullptr);.

Parameters

arg - narrow character string identifying the contents of a NaN

Return value

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