On Tuesday, October 15, 2002, at 07:05 AM, Michael G Schwern wrote: > This came up at YAPC::Europe. Someone [1] wanted to know if 1/0 would > produce a divide by zero error in Perl 6, or if it would return a value > representing an indeterminate result (undef?) It would make more sense > for > Perl, upon being given a simple bit of impossible math, to return undef > (like other functions do on failure) than to generate an error. The > error > seems a throwback to earlier days of hardwired calculators.
Well, if you're an exceptions guy like me, you'd *much* rather have it produce an error than a zero, which I assume undef would still evaluate to. NaN is another option, following some standard or other. > [2] Discussion of divide by zero and why it's not infinity [3] > http://mathforum.org/dr.math/faq/faq.divideby0.html > > [3] I was always taught it's infinity. Positive or negative infinity? (it's a trap!) -Ken