cocoa - I've discovered what I think is a bug with double numbers...
- by Mike
Here is a simple code that shows what I think is a bug when dealing with double numbers...
double wtf = 36.76662445068359375000;
id xxx = [NSDecimalNumber numberWithDouble: wtf];
NSString *myBug = [xxx stringValue];
NSLog(@"%.20f", wtf);
NSLog(@"%@", myBug);
NSLog(@"-------\n");
the terminal will show two different numbers
36.76662445068359375000
and
36.76662445068359168
Is this a bug or am I missing something?
if the second number is being rounded, it is a very strange rounding btw...