Yep. It’s also the only way that I know of to get the sign of a NaN. We can’t even parse the repr for that!
Exactly -- while a tiny bit handy for ints, floats are where it is really *needed*.
And back to Guido's point -- while called "math", the math module really is a "float_math" module. It began as a wrapper around the C math library, and while it has grown a number of Python specific functions, I'm pretty sure all the ones that reflect C math functions are essentially unchanged, and it should probably stay that way.
-CHB
--
Christopher Barker, PhD
Python Language Consulting
- Teaching
- Scientific Software Development
- Desktop GUI and Web Development
- wxPython, numpy, scipy, Cython