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
x == -1.0 / 0.0
This expression evaluates to true iff x is negative infinity.
If you are willing to include cmath, then x == - INFINITY is more readable.
Assuming that floating-point types are mapped to IEEE 754 formats, then each of them has its own infinity. 1.0 / 0.0 is a double infinity. It doesn't matter much the type of INFINITY because “usual arithmetic conversions” will take care of matching the types of the left- and right-hand-side of ==.