If I create an NSNumber
with a double value of 0.085
, it seems extra precision gets added to the number. However, this isn't the case with 0.85
. I don't understand why this is the case, but I'm sure there's a really obvious answer. Does anyone know why?
For example:
NSNumber *n1 = [NSNumber numberWithDouble:0.85];
NSNumber *n2 = [NSNumber numberWithDouble:0.085];
NSLog(@"Number: %@", n1); // Number: 0.85
NSLog(@"Number: %@", n2); // Number: 0.08500000000000001