2011-02-08 5 views

答えて

4

それとも、別のアプローチを使用することができるために用意されています

float value; 
int base; //base to round 

int round_down=(int)((int)(value/base))*base; 
int round_up=(int)((int)(value/base+0.5))*base; 
1

Math.ceil() or Math.floor()が、これらは再びのみCLDC 1.1 :)