如何获得max int值?

时间:2013-09-17 06:54:28

标签: objective-c int floor ceil

大家好,我有以下代码:

(int)index

double result=((double)index*0.5);
DebugLog(@"result %f", result); -- GIVES ME 0.00
DebugLog(@"result %f", floor(result)); ALSO GIVES ME 0.00

double result=ceil(((double)index*0.5));
DebugLog(@"result %f", result); ---- 0.000

我需要得到0.5的结果,当做一个地板得到1.帮助。?

0 个答案:

没有答案