Scala has Double.isNaN
for detecting not-a-number but no Double.isInf
for detecting (positive or negative) infinity.
Why? I'd like to check whether a parameter is a "real" number (i.e. has a numeric value). Converting it to a string and checking for "inf" or something will do it, but there must be a better way?
Like in C++: http://en.cppreference.com/w/cpp/numeric/math/isinf
Using Scala 2.10