sta*_*tti 2 c++ floating-point numbers
是否存在isnormal,isnan等C函数的C++版本?我知道我可以使用C++中的C函数,但我总是很想知道是否有一些C++ - 只有替代品.
它们包含在<cmath>C++ 0x草案中:
template <class T> int fpclassify(T x);
template <class T> bool isfinite(T x);
template <class T> bool isinf(T x);
template <class T> bool isnan(T x);
template <class T> bool isnormal(T x);
Run Code Online (Sandbox Code Playgroud)