On 2002-10-14 at 20:15:33, Michael G Schwern wrote: > There are several verbal proofs why 1/0 is not +Infinity here: > http://mathforum.org/dr.math/faq/faq.divideby0.html Yeah, that would be why I sent my followup. I did not mean to imply that 1/0 is positive infinity in "real world math".
However, returning Infinity when asked to divide a finite number by 0 is conformant behavior according to the IEEE spec. An implementation is *allowed* to indicate an error on division by 0, but is not *required* to - returning infinity is legal. It is also, as an example, the behavior required by the ECMAScript specification. In any case, my point was simply that 1/0 is not NaN. If you're going to return a defined value as the result of 1/0, you should return +Infinity instead. NaN is used for other purposes, such as square roots of negative numbers when complex numbers are not available, or as the return value of failed numeric coercions, or of operations where even as a limit the result is indeterminate, such as 0/0. -- Mark REED | CNN Internet Technology 1 CNN Center Rm SW0831G | [EMAIL PROTECTED] Atlanta, GA 30348 USA | +1 404 827 4754