what are math function in java
Answers
Answer:
java us edition in minecraft
Explanation:
it is language
Answer:
★ Math.pow(x, y) → Returns the value of the first argument, raised to the power of second argument.
Example :- Math.pow(2, 3) = 2³ = 8
★ Math.sqrt(x) → Returns the square root of a double value (√x).
Example:- Math.sqrt(4) = √4 = 2
★ Math.cbrt(x) → Returns the cube root of a double value. [x^(1/3)]
Example:- Math.cbrt(8) = 8^(1/3) = 2
★ Math.ceil(x)→ Returns the smallest integer that is greater than or equal to the argument.
Example:- Math.ceil(4.6) = 5.0
★ Math.floor(x) → Returns the largest integer that is less than or equal to the argument.
Example:- Math.floor(4.6) = 4
★ Math.round(x) → Returns the closest int or long (as per the argument).
Examples:-
- Math.round(4.5) = 5.0
- Math.round(4.4) = 4.0
★ Math.abs(a) → Returns the absolute value of the argument.
Examples :-
- Math.abs(-4) = 4
- Math.abs(4) = 4
★ Math.max(a, b) → Returns the largest value of the two arguments.
Example :-
- Math.max(4.0, 5.0) = 5.0
★ Math.min(a, b) → Returns the smallest value of the two arguments.
Example :-
- Math.min(4.0, 5.0) = 4.0
★ Math.random() → Returns a double value that is greater than or equal to 0.0 and less than 1.0.
Example :-
- random() = 0.5
Explanation:
The Math class of the java.lang package contains a lot of generic mathematical functions including geometric and trigonometric functions.