std::fpclassify (3) - Linux Manuals
std::fpclassify: std::fpclassify
NAME
std::fpclassify - std::fpclassify
Synopsis
Defined in header <cmath>
int fpclassify( float arg ); (1) (since C++11)
int fpclassify( double arg ); (2) (since C++11)
int fpclassify( long double arg ); (3) (since C++11)
int fpclassify( IntegralType arg ); (4) (since C++11)
1-3) Categorizes floating point value arg into the following categories: zero, subnormal, normal, infinite, NAN, or implementation-defined category.
4) A set of overloads or a function template accepting the from argument of any integral_type. Equivalent to (2) (the argument is cast to double).
Parameters
arg - floating point value
Return value
one of FP_INFINITE, FP_NAN, FP_NORMAL, FP_SUBNORMAL, FP_ZERO or implementation-defined type, specifying the category of arg.
Example
// Run this code
Output:
See also
isfinite checks if the given number has finite value
(C++11)
isinf checks if the given number is infinite
(C++11)
isnan checks if the given number is NaN
(C++11)
isnormal checks if the given number is normal
(C++11)
numeric_limits (class template)