大家好,我有以下代码:
(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.帮助。?