Computer Applications
Give the output of Math.ceil(-0.6)
- -1.6
- -1.5
- -1.0
- -0.0
Java Math Lib Methods
15 Likes
Answer
-0.0
Reason — Math.ceil method returns the smallest double value that is greater than or equal to the argument and is equal to a mathematical integer. Thus, Math.ceil(-0.6) returns -0.0.
Answered By
9 Likes
Related Questions
Consider the following code snippet:
float x = 8.25F; int y; y = (int)x;What are the values of x and y?
- x = 8.25, y = 8
- x = 8.0, y = 8.0
- x = 8, y = 8.25
- x = 8, y = 8
Parameters in method definition are called
- actual parameters
- formal parameters
- informal parameters
- void parameters
Which operator cannot be used with if-else statement?
- <=
- ||
- &&
- ? :
By default, floating literal is
- double
- float
- int
- long