Math Methods

Math Methods

The Java Math class provides several methods that allows us to work on mathematical calculations with numbers.

Math.method();

Here are the Math methods in alphabetical order:

Math Methods

Math.abs()
Returns the absolute value of the argument.
Math.acos()
Returns the inverse cosine of the argument in radians.
Math.asin()
Returns the inverse sine of the argument in radians.
Math.atan()
Returns the inverse tangent of the argument in radians.
Math.atan2()
Returns the counterclockwise angle, in radians, between a (x,y) point and the positive x-axis.
Interested in helping build Docs? Read the Contribution Guide or share your feedback.

Learn Java on Codecademy