Re: [SOLVED...but] Re: Storing NaN in NSMutableArray ?
Re: [SOLVED...but] Re: Storing NaN in NSMutableArray ?
- Subject: Re: [SOLVED...but] Re: Storing NaN in NSMutableArray ?
- From: Marco Scheurer <email@hidden>
- Date: Wed, 10 Mar 2004 22:02:13 +0100
On Mar 10, 2004, at 9:23 PM, Kubernan @ 10191 Tec. wrote:
Re,
I'm sorry to say that
[anArray addObject:[NSDecimalNumber notANumber]];
was never called :-(
Now it works : NSLog prints NaN. But the test below :
"if ([[anArray objectAtIndex:0] isEqualTo:[NSDecimalNumber
notANumber]])"
always returns TRUE even if the the value at the index 0 is a NSNumber
equal to +0.0 (that is not NaN value).
(same result with "isEqual" instead of "isEqualTo").
I also tried :
"if ([[anArray objectAtIndex:0] compare:[NSDecimalNumber notANumber]]
...)"
With no success.
Why +0.0 is equal to NaN ??
Because there's still something wrong in your code, I would say. How do
you get "a NSNumber equal to +0.0" ? This is what the most elementary
tests give:
should ([[NSDecimalNumber notANumber] isEqual:[NSDecimalNumber
notANumber]]);
shouldnt ([[NSDecimalNumber notANumber] isEqual:[NSNumber
numberWithFloat:0.0]]);
Test Case '-[TestLab testNaN]' passed (0.001 seconds).
Marco Scheurer
Sen:te, Lausanne, Switzerland
http://www.sente.ch
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.