From:

Date:

October 10, 2001 08:16Subject:

Re: NaN semanticsMessage ID:

3BC46284.CC5D5F44@rfl.plDamian Conway wrote: > > 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. OK, now I see your point even better. The difference in our points is that I suggested that numerical comparison of NaNs shouldn't make sense. But yes, two NaNs are equally not numbers. Now the question is if being a NaN should be the special case of numerical meaning or the lack of any numerical meaning. I don't think that the one idea is more correct than another, maybe that's the matter of taste, however they are mutually exclusive, so one of them has to be chosen. I joined this thread, because I thought that assuming that NaN!=NaN idea is just ugly and thus not worth deeper discussion, was oversimplifying and the problem deserves a little more of controversy. However I wasn't suspecting that NaN semantics will grow to one of the most important threads here. > 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. Well, Laziness is very important to me, but here it won't be hurt much, as in fact $x==$y!=NaN wouldn't be used very often. Only when numerically comparing two unknown values, and I can't remember when I did it last time. Maybe when sorting but with sorting it doesn't matter if every NaN is equal or not. Hmmm, maybe NaN==NaN would make starship operator simpler..? Anyway, even with NaN==NaN 'text'!=0, unlike Perl 5, where 'text'==0, which could've been the main problem with == operator. - RaFaL Pocztarski, admin@rfl.plThread Previous | Thread Next

- NaN semantics by Tim Conrow
- RE: NaN semantics by Damian Conway
- Re: NaN semantics by Dan Sugalski
- Re: NaN semantics by RaFaL Pocztarski
- Re: NaN semantics by Damian Conway
- Re: NaN semantics by Piers Cawley
- RE: NaN semantics by Richard_Cox
- RE: NaN semantics by Dan Sugalski
- Re: NaN semantics by Jonathan Scott Duff
- RE: NaN semantics by Dan Sugalski
- Re: NaN semantics by Dan Sugalski
- Re: NaN semantics by Bart Lateur
- Re: NaN semantics by Dan Sugalski
- Re: NaN semantics by Glenn Linderman
- Re: NaN semantics by RaFaL Pocztarski
- Re: NaN semantics by Jonathan Scott Duff
- Re: NaN semantics by Dan Sugalski
- Re: NaN semantics by Michel Rodriguez
- Re: NaN semantics by Sam Vilain
- Re: NaN semantics by RaFaL Pocztarski
- Re: NaN semantics by Trond Michelsen
- Re: NaN semantics by Aaron Sherman
- Re: NaN semantics by Glenn Linderman
- Re: NaN semantics by RaFaL Pocztarski
- Re: NaN semantics by RaFaL Pocztarski
- Re: NaN semantics by RaFaL Pocztarski
- Re: NaN semantics by RaFaL Pocztarski
- RE: NaN semantics by David Whipp
- Re: NaN semantics by RaFaL Pocztarski
- NaN+NaNi by David Nicol
- Re: NaN+NaNi by Dan Sugalski
- Re: NaN+NaNi by Jonathan Scott Duff
- Re: NaN+NaNi by RaFaL Pocztarski
- Re: NaN+NaNi by raptor
- Re: NaN+NaNi by RaFaL Pocztarski
- Re: NaN+NaNi by Aaron Sherman
- Re: NaN+NaNi by Jonathan Scott Duff
- 3.243F6A888+C0FFEe-4i by David Nicol
- Re: NaN+NaNi by RaFaL Pocztarski
- Re: NaN+NaNi by Glenn Linderman
- Re: NaN+NaNi by RaFaL Pocztarski
- Re: NaN+NaNi by RaFaL Pocztarski
- Re: NaN+NaNi by RaFaL Pocztarski
- Re: NaN+NaNi by RaFaL Pocztarski
- Re: NaN semantics by Jonathan Scott Duff
- Re: NaN semantics by RaFaL Pocztarski
- RE: NaN semantics by David Whipp
- Re: NaN semantics by raptor
- Re: NaN semantics by Jonathan Scott Duff
- RE: NaN semantics by Brent Dax
- Re: NaN semantics by Dan Sugalski
- Re: NaN semantics by Nicholas Clark
- Re: NaN semantics by Mark
- Re: NaN semantics by Damian Conway
- RE: NaN semantics by Damian Conway
- Re: NaN semantics by Damian Conway
- RE: NaN semantics by Brent Dax
- Re: NaN semantics by Damian Conway
- Re: NaN semantics by Tim Conrow
- Re: NaN semantics by Damian Conway
- Re: NaN semantics by Damian Conway
- RE: NaN semantics by David Whipp
- Re: NaN semantics by Graham Barr
- Re: NaN semantics by Piers Cawley
**Re: NaN semantics**by RaFaL Pocztarski- Re: NaN semantics by Damian Conway
- Re: NaN semantics by Tim Conrow
- Re: NaN semantics by Damian Conway
- Re: NaN semantics by Me
- Re: NaN semantics by merlyn
- Re: NaN semantics by RaFaL Pocztarski
- Re: NaN semantics by RaFaL Pocztarski
- Re: NaN semantics by John Siracusa
- Re: NaN semantics by RaFaL Pocztarski
- Re: NaN semantics by David Nicol
- Re: NaN semantics by RaFaL Pocztarski

nntp.perl.org: Perl Programming lists via nntp and http.

Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About