std::nan - Serbipunk/notes GitHub Wiki

检测nan

std::isnan

fval != fval

生成nan

Defined in header

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:

⚠️ **GitHub.com Fallback** ⚠️