class name - Math_Operation
fileName - Math_Operation.java
Java:
import java.lang.Math;
class Math_Operation
{
public static void main(String[] args)
{
// floor() returns he largest (closest to positive infinity)
// double value that is less than or equal to the argument and
// is equal to a mathematical integer
System.out.println("Math.floor(10) = "+Math.floor(10));
System.out.println("Math.floor(7) = "+Math.floor(7));
//ceil() Returns the smallest (closest to negative infinity)
// double value that is greater than or equal to the argument
// and is equal to a mathematical integer
System.out.println("Math.ceil(6.251) = "+Math.ceil(6.251));
//min() Returns the smaller of two int values
System.out.println("Math.min(17,41) = "+Math.min(17, 41));
//pow() Returns the value of the first argument raised to the power of the second argument
System.out.println("Math.pow(6,2) = "+Math.pow(6, 2));
//abs() Returns the absolute value of an int value
System.out.println("Math.abs(-53) = "+Math.abs(-53));
//round() Returns the closest long to the argument
System.out.println("Math.round(21.47) = "+Math.round(21.47));
}
}
class name - Math_Operation
fileName - Math_Operation.java
Java:
import java.lang.Math;
class Math_Operation
{
public static void main(String[] args)
{
// floor() returns he largest (closest to positive infinity)
// double value that is less than or equal to the argument and
// is equal to a mathematical integer
System.out.println("Math.floor(10) = "+Math.floor(10));
System.out.println("Math.floor(7) = "+Math.floor(7));
//ceil() Returns the smallest (closest to negative infinity)
// double value that is greater than or equal to the argument
// and is equal to a mathematical integer
System.out.println("Math.ceil(6.251) = "+Math.ceil(6.251));
//min() Returns the smaller of two int values
System.out.println("Math.min(17,41) = "+Math.min(17, 41));
//pow() Returns the value of the first argument raised to the power of the second argument
System.out.println("Math.pow(6,2) = "+Math.pow(6, 2));
//abs() Returns the absolute value of an int value
System.out.println("Math.abs(-53) = "+Math.abs(-53));
//round() Returns the closest long to the argument
System.out.println("Math.round(21.47) = "+Math.round(21.47));
}
}