Well, this is really bizarre because by definition C passes floats as doubles on the stack, and since ObjC methods get turned into C functions, even with a float parameter the float is extended to a double. All that said, its possible the compiler is putting the 17.0 into a float, then extended it to a double, and somehow iOS is looking at that exact binary number (comparing it), whereas if you pass a double directly, it is slightly different and ends up as a fractional font.
So I got curious and decided to try a test:
- (void)test:(float)foo
{
union {
float f;
uint32_t u;
} u;
u.f = foo;
NSLog(@"foo=%.15f hex=%x", u.f, u.u);
}
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
[self test:17.0];
[self test:17.0f];
Output:
2012-09-13 16:02:34.035 Searcher[73472:f803] foo=17.000000000000000 hex=41880000
2012-09-13 16:02:34.036 Searcher[73472:f803] foo=17.000000000000000 hex=41880000
The numbers were exactly the same, same as the hex. Something is obviously wrong elsewhere in your code.