I found this: http://en.cppreference.com/w/cpp/numeric/math/isinf but it appears to check for either positive or negative infinity. I just want to check if a value is equal
How about the obvious and explicit?
To check that a double x is negative infinity, check
double x
x == -std::numeric_limits::infinity()
If x is some other floating-point type, change double as appropriate.
x
double
std::numeric_limits is defined in the standard header . Don't forget to add it to your #include list.
std::numeric_limits
#include