Re: Compare NSNumber with an int
Re: Compare NSNumber with an int
- Subject: Re: Compare NSNumber with an int
- From: Nat! <email@hidden>
- Date: Mon, 15 Dec 2003 16:38:14 +0100
Am 15.12.2003 um 15:38 schrieb Just van Rossum:
The docs for intValue say "Returns the receiver's value as an int,
converting it as necessary.", which suggests the former should work
just
as well (but with less overhead).
That depends, if you want 10.2 and 10 to be equal or not
[[NSNumber numberWithInt:10] isEqual:[NSNumber numberWithDouble:10.2]]
yields NO
[[NSNumber numberWithInt:10] intValue] == [[NSNumber
numberWithDouble:10.2] intValue] yields YES
Ciao
Nat!
I act professionally, when I get paid for it. - Unknown
_______________________________________________
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.