KnowledgeBoat Logo

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