
On Fri, Jan 11, 2008 at 07:10:20PM -0800, Jonathan Cast wrote:
On 11 Jan 2008, at 10:12 AM, Achim Schneider wrote:
David Roundy
wrote: Prelude> let x=1e-300/1e300 Prelude> x 0.0 Prelude> x/x NaN
The "true" answer here is that x/x == 1.0 (not 0 or +Infinity), but there's no way for the computer to know this, so it's NaN.
Didn't catch this the first time around, but: only to a physicist.
I don't understand what you're saying below. Do you mean that the "true" answer is not 1.0, or that it's not reasonable for the computer to call it NaN? Since 1.0 is the answer you get for high-precision computations, it's hard to see how you can argue that it's a wrong answer.
(I mean no disrespect to the author of darcs, but nevertheless the point stands). Back in the real world, 0 / 0 may be defined arbitrarily, or left undefined. (Defining it breaks the wonderful property that, if lim (xn) = x, lim (yn) = y, and x/y = z, then lim (xn / yn) = z. This is considered a Bad Thing by real mathematicians). In fact, in integration theory 0 * inf = 0 for certain 'multiplications', which gives the lie to 0 / 0. -- David Roundy Department of Physics Oregon State University