Computer Science, asked by meghasarthak6, 2 months ago

if float x= -3.89f. then Math.ceil(x)=?



only icse students can answer ​

Answers

Answered by atrs7391
1

if float x= -3.89f. then Math.ceil(x)= -3.0

Btw, how are you sure that only ICSE students can answer! Tho I am one....

More about Math.ceil() function:

Returns the smallest (closest to negative infinity) double value that is greater than or equal to the argument and is equal to a mathematical integer. Special cases:

If the argument value is already equal to a mathematical integer, then the result is the same as the argument.

If the argument is NaN or an infinity or positive zero or negative zero, then the result is the same as the argument.

If the argument value is less than zero but greater than -1.0, then the result is negative zero.

Note that the value of Math.ceil(x) is exactly the value of -Math.floor(-x).

Similar questions