develooper Front page | perl.perl6.language | Postings from October 2001

Re: NaN semantics

Thread Previous | Thread Next
Damian Conway
October 8, 2001 23:39
Re: NaN semantics
Message ID:
   > But I assume that == means numerically equal (and here I could be
   > wrong). If what I assume is true however, then anything which doesn't
   > have any numerical meaning, numerically compared to anything (even to
   > itself) should not return the misleading result that the two compared
   > values are numerically equal.
   > Then again, if you tell me that == operator doesn't mean "numerically
   > equal", I will agree that NaN==NaN should be true even considering that
   > 'cat'=='dog' will also be true.

But 'cat'=='dog' *is* true. Numerically, they *are* equal.
They are equally not numbers.  One should certainly get a warning
(and one will if warnings are enabled), but this 
expression shouldn't return false.

Sigh. I *do* see your point of view (Laziness), but I still have immense
difficulty with the notion that:

        $x == NaN

doesn't return true if $x contains NaN.


Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About