posted 23 years ago
Hi
Ur doubt is correct, but 've to understand .
Actually, when u pass a +ve number eg: 3.4 , u get 4.0
When u pass a -ve number eg: -12.4 , u get -12.0 { because -12.0 is greater than -13.0 }
ie., -ve..... -13,-12,-11,...,-1,0,1,2,3,4,5,6....,12,13 ....+ve
Also have a look at javadoc expalnation
ceil:
-----
public static double ceil(double a)
Returns the smallest (closest to negative infinity) double value that is not less than the argument and is equal to a mathematical integer.
Parameters:
a - a double value.
Returns:
the smallest (closest to negative infinity) double value that is not less than the argument and is equal to a mathematical integer.