Actually, 1/0 is not NaN; it's +Infinity. You only get NaN out of
dividing by 0 if the numerator is either infinite or also 0.
The reason most implementations throw an error on division by 0
is that they either don't have a representation for infinity
(not a problem in IEEE floating point) or the rest of the arithmetic
operations don't behave sensibly when handed an infinite value.
I would argue that Perl's arithmetic operations should behave sensibly
on infinite values and that 1/0 should therefore just return +Infinity.
No exception, no error, no undefined value.
Summary of values:
1/0 +Inf
-1/0 -Inf
0/0 NaN
Inf/0 NaN (Sign doesn't matter for these two;
Inf/Inf NaN +Inf and -Inf may be interchanged)
--
Mark REED | CNN Internet Technology
1 CNN Center Rm SW0831G | [EMAIL PROTECTED]
Atlanta, GA 30348 USA | +1 404 827 4754