[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Scheme-reports] Proposed language for 'eqv?' applied to inexact real numbers



Ray Dillinger scripsit:

> NaN is NOT A NUMBER, and the question of its numeric
> equivalence to anything does not make sense.  The question
> is a category error and therefore both the "true" answer
> and the "false" answer are meaningless.

Sometimes, but not always.  Thus, 0/0 and infinity - infinity are
not "no real number at all" (as sqrt(-2) is) but "any real number
at all".  Furthermore, two branches of a computation that are to be
compared for equality may both generate NaN, but for entirely different
reasons.  Since = is a conservative approximation to equality, it's
correct for NaN=Nan to return false, meaning "no match".

-- 
John Cowan  cowan@x    http://ccil.org/~cowan
Big as a house, much bigger than a house, it looked to [Sam], a grey-clad
moving hill.  Fear and wonder, maybe, enlarged him in the hobbit's eyes,
but the Mumak of Harad was indeed a beast of vast bulk, and the like of him
does not walk now in Middle-earth; his kin that live still in latter days are
but memories of his girth and his majesty.  --"Of Herbs and Stewed Rabbit"

_______________________________________________
Scheme-reports mailing list
Scheme-reports@x
http://lists.scheme-reports.org/cgi-bin/mailman/listinfo/scheme-reports