Find floor value of a number using Math.floor in Java
Description
The following code shows how to find floor value of a number using Math.floor.
Example
/*from www . j a v a2s. com*/
public class Main {
public static void main(String[] args) {
System.out.println(Math.floor(70));
System.out.println(Math.floor(31.1));
System.out.println(Math.floor(12.5));
System.out.println(Math.floor(-10));
System.out.println(Math.floor(-12.4));
System.out.println(Math.floor(0));
}
}
The code above generates the following result.