Computer Applications
Predict the output of the following:
System.out.println(Math.floor(-0.88));
Java
Java Math Lib Methods
53 Likes
Answer
-1.0
Working
Math.floor method returns the largest double value that is less than or equal to the argument and is equal to a mathematical integer. As -1.0 is the largest mathematical integer less than -0.88 so it is the output.
Answered By
22 Likes
Related Questions
Predict the output of the following:
System.out.println(Math.round(-18.51));
Predict the output of the following:
System.out.println(Math.rint(98.5));
Predict the output of the following:
System.out.println(Math.max(-77.66, -87.45));
Predict the output of the following:
System.out.println(Math.ceil(65.5));