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

Re: NaN semantics

Thread Previous | Thread Next
Piers Cawley
October 7, 2001 14:30
Re: NaN semantics
Message ID:
Damian Conway <> writes:

>    > His point was that the NaN IEEE came up with is defined to have
>    > NaN != NaN, and that it might be confusing if Perl's behavior
>    > wasn't consistent with that. Not that I think NaN != NaN is a
>    > particularly good idea, but consistency with other languages
>    > may be. If NaN != NaN, then his example is correct.
> Sorry. I was focused on the Perl 6 semantics and missed that
> implication.
> Let me make it clear: AFAIK Perl NaN's will not be IEEE 754
> compliant. That was certainly my intention in suggesting them to
> Larry. I share the view of a number of other language designers that
> the non-self-identity of IEEE NaN is (to slightly misquote Tim)
> "ugly, non-intuitive and ugly; and non-intuitive too".

But NaN could already be argued to be ugly, non intuitive and ugly.
When you compare two indeterminate quantities (if quantity is even the
right word) then expecting them to be equal is somewhat surprising.

Maybe NaN is a misnomer, since NaN already has a defined meaning in
this context, the IEEE sense. Changing its semantics in a perl context
is surely a recipe for confusion (assuming you're not already confused
by the IEEE behaviour). 

Trouble is, I'm not entirely sure what a good name for this would be.


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