float nanf( const char* arg );
(1) (since C++11)double nan ( const char* arg );
(2) (since C++11)long double nanl( const char* arg );
(3) (since C++11)Converts the character string arg into the corresponding quiet NaN value, as if by calling std::strtof, std::strtod, or std::strtold, respectively.
1)The call
std::nanf("n-char-sequence"), where
n-char-sequenceis a sequence of digits, ASCII letters, and underscores, is equivalent to the call
std::strtof("NAN(n-char-sequence)", (char**)nullptr);.
The call
std::nanf("")is equivalent to the call
std::strtof("NAN()", (char**)nullptr);.
The call
std::nanf("string"), where
stringis neither an
n-char-sequencenor an empty string, is equivalent to the call
std::strtof("NAN", (char**)nullptr);.
[edit] Parameters arg - narrow character string identifying the contents of a NaN [edit] Return valueThe quiet NaN value that corresponds to the identifying string arg or zero if the implementation does not support quiet NaNs.
If the implementation supports IEEE floating-point arithmetic (IEC 60559), it also supports quiet NaNs.
[edit] Error handlingThis function is not subject to any of the error conditions specified in math_errhandling.
[edit] ExamplePossible output:
nan("1") = nan (7ff0000000000001) nan("2") = nan (7ff0000000000002)[edit] See also checks if the given number is NaN
std::numeric_limits<T>
) [edit] identifies floating-point types that can represent the special value "signaling not-a-number" (NaN)
std::numeric_limits<T>
) [edit] returns a quiet NaN value of the given floating-point type
std::numeric_limits<T>
) [edit] returns a signaling NaN value of the given floating-point type
std::numeric_limits<T>
) [edit]
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4