>>It's ridiculous anyway. In any type of math, division by zero is not supposed to be 'infinity', it's supposed to be 'undefined'. But you're right, infinity should be outside the range of double and float, but they have special values of positive infinity and negative infinity. I have no good idea why. 5/0 gives positive infinity. -5/0 gives negative infinity.
>
>
http://en.wikipedia.org/wiki/Divide_by_zeroA pretty good writeup, but unfortunately, it never really explains the need for computers to calculate 1/0 = positive infinity and -1/0 = negative infinity. In fact, he even says that most computer programs, even though it's allowed, return an error condition because of the algebraic inconsitencies if you try to divide by zero.