posted 24 years ago
CEIL (up, roof)

ceil returns the round off to integer double value which is greater than or equal to the argument (d) passed to ceil(double d) argument but close to Negative Infinity. It implies that if you have 14.9 as an argument then it means that int value greater than 14.7 may be 15, 16, 17, and so on so we have a set containing {15,16,17,18, .......Positive infinity}

Now choose the value from this set which is close to negative infinity which is 15.0 in double

FLOOR (down, you walk on floor)

Floor returns the round off to integer double value that is less than or equal to the value passed into the argument (d) of floor(double d) function and close to the Positive Infinity. It implies that if you have 90.7 the the integer values that are less than 90.7 are 90,89,88, and so on so we have set

{negative infinity ..........88,89,90}

Now choose the value which is close to the positive infinity so that value is 90.0 (double).

Round Off to close Integral value

round(14.9) = 15 (long value is returned)

Now you can answer the questions. Hope you will understand the difference.