Merry Christmas!
Can someone explain this?
| /home/xenofarm/xenoclient/pike-7.5/orchid.mirar.org/buildtmp/Pike7.5-20031224-171314/src/modules/Math/testsuite.in:113: | Test 22 (shift 1) (CRNL) failed. | 1: mixed a() { return Math.nan == Math.nan ; } | 2: | | o->a(): 1
Why is that considered a failure?
In the last episode (Dec 24), Mirar @ Pike developers forum said:
Merry Christmas!
Can someone explain this?
| /home/xenofarm/xenoclient/pike-7.5/orchid.mirar.org/buildtmp/Pike7.5-20031224-171314/src/modules/Math/testsuite.in:113: | Test 22 (shift 1) (CRNL) failed. | 1: mixed a() { return Math.nan == Math.nan ; } | 2: | | o->a(): 1
Why is that considered a failure?
I belive NaN is like NULL in SQL; it is an unknown value that is never equal to anything. To determine if something is NaN, you have to call isnan().
Yes. Should NaN!=NaN be true in C99? The fault is when using icc.
/ Mirar
Previous text:
2003-12-24 21:40: Subject: Re: Merry Christmas == 1!
nan gets also returned by things like asin() if you enter an invalied value:
asin(2.0);
(8) Result: nan
here is the interresting part:
asin(2.0)==asin(1.5);
(9) Result: 0
asin(2.0)==asin(2.0);
(10) Result: 0
in mirars example the result was 1.
greetings, martin.
/ Brevbäraren
pike-devel@lists.lysator.liu.se