Home >>Java Math Methods >Java Math.floor() method
The Math.floor() Method in Java Math is used to find the largest integer value that is less than or equal to the argument, which is equal to a double value's mathematical integer.
public static double floor(double a)
x= This parameter is used for a value
This method is used to returns largest floating-point value that is less than or equal to the argument and is equal to a mathematical integer of a double value.
public class MyClass
{
public static void main(String[] args)
{
double a = 12.34;
System.out.println(Math.floor(a));
}
}
public class MyClass
{
public static void main(String[] args)
{
double a = -19.14;
System.out.println(Math.floor(a));
}
}