Why using double instead of float in Objective-C

Try the code like following

NSString* s= @"10000000.01";
float f = [s floatValue];
double d = [s doubleValue];

if(f > 10000000)
{
    NSLog(@"Over Value");
}
else {
    NSLog(@"OK Float");
}

if(d > 10000000)
{
    NSLog(@"Over value");
}
else {
    NSLog(@"OK Double");
}

How do you think ? What results will show ?

When I run , actual result is like following

2013-04-19 17:07:29.284 float[2991:907] OK Float
2013-04-19 17:07:29.287 float[2991:907] Over value
comments powered byDisqus