|
From: | Marcus Müller |
Subject: | Re: NSNumber Bug I can't fix |
Date: | Thu, 17 Feb 2011 17:01:47 +0100 |
#define COMPARE(value, other) \ if (value < other)\ {\ return NSOrderedAscending;\ }\ if (value > other)\ {\ return NSOrderedDescending;\ }\ return NSOrderedSame; If either is a nan, this will return NSOrderedSame which is, well, not incorrect. However, in the context of NSNumber.m:165 it returns a wrong result. This raises the question, what should be done to - (NSComparisonResult) compare: (NSNumber*)aNumber? Comparing a NaN with another number is undefined and might lead to NSOrderedSame, but it should never lead to [2 isEqualToNumber:NaN] == YES. I'm not sure how to fix this properly, but not returning NSOrderedSame in this case would certainly help. Cheers, Marcus -- Marcus Mueller . . . crack-admin/coder ;-) Mulle kybernetiK . http://www.mulle-kybernetik.com Current projects: http://www.mulle-kybernetik.com/znek/ |
smime.p7s
Description: S/MIME cryptographic signature
[Prev in Thread] | Current Thread | [Next in Thread] |