objective-c divide always returns 0

Something really weird is happening.

float p1 = (6 / 100);
NSLog(@"p1 = %f", p1);

With those two lines of code I get the following output:

p1 = 0.000000

Why is a simple devide with static numbers not working! I have so much work to do to deal with divide not working! What he heck, am I crazy?

18
задан Pointy 13 September 2010 в 16:48
поделиться