Hi
I would guess it's the simplest thing but it's really confusing me. I'm sure I've successfully used doubles before but now I'm having trouble.
I just made a new 'test' project to see if I can get it working, but all I'm trying to do is set a double value.
So in the View Controller's viewDidLoad i've typed:
double z = 2938.09;
NSLog(@"z = %d", z);
I would expect it to output 'z = 2938.09' but instead I get 'z = 343597384'
double z = 3.4 returns z = 858993459
Also most integer values report back as z = 0, however not always (sometimes another strange number as above is spewed out)
Am I missing something here or it something strange going on??
Even tried stuff like
NSString *newString = [[NSString alloc] initWithString:@"3.4"];
double z = [newString.text doubleValue];
NSLog(@"z = %d", z);
[newString release];
but still get the crazy z = 858993459 :(