Computer Applications
What will be the output of Math.floor(-20.10);
?
- -20.0
- -21.0
- 20
- 21
Java Math Lib Methods
5 Likes
Answer
-21.0
Reason — Math.floor() method returns the largest double value that is less than or equal to the argument and is equal to a mathematical integer. Thus, -21.0 is returned by Math.floor(-20.10);
method.
Answered By
2 Likes
Related Questions
Which of the following is mandatory in the switch statement?
- break
- continue
- case
- default
Which of the following is not a valid method of the Scanner class?
- next( )
- nextInt( )
- nextLong( )
- nextNumber( )
Which of the following is an illegal identifier?
- age
- 123abc
- _value
- salary
Which of the following is/are jump statement used in Java?
- break
- continue
- return
- All of these