When I run the following code ,
NSString* s= @"10000000.01";
float f = [s floatValue];
double d = [s doubleValue];
if(f > 10000000)
if(d > 10000000)
2013-04-19 17:07:29.284 float[2991:907] OK Float
2013-04-19 17:07:29.287 float[2991:907] Over value
float is 32-bit while
double is 64-bit. A float has fewer significant digits than double.
float value doesn't store enough to hold the 10 digits of your
Also see Difference between float and double for more details. That is about C/C++ but it applies to Objective-C as well.