Java Math.floorDiv() methodThe java.lang.Math.floorDiv() is used to find the largest integer value that is less than or equal to the algebraic quotient. This method first divide the first argument by the second argument and then performs a floor() operation over the result and returns the integer that is less or equal to the quotient. SyntaxParameterReturn
Example 1Test it NowOutput: 8 Example 2Test it NowOutput: -9 Example 3Test it NowOutput: Runtime Error: Exception in thread "main" java.lang.ArithmeticException: / by zero at java.lang.Math.floorDiv(Math.java:1052) at floorDivExample1.main(floorDivExample1.java:8) Example 4Test it NowOutput: -2148 Next TopicJava Math |
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India