Java Math Methods | Programiz D11 Phase 2 Skip to main content

Java Math Methods

Java has a lot of Math methods that allow us to perform mathematical computations. In this reference page, you will find all the math methods available in Java. For example, if you need to get the square root of a number, use the sqrt() method.

returns the absolute value of a number

returns the arc cosine of the specified value

adds the specified numbers and returns it

returns the arc sine of the specified argument

returns the inverse tangent function of a value

returns the cosine of the specified angle

returns the sine of the specified angle in radians

returns the tangent value of the specified angle

returns the hyperbolic sine of the specified value

returns hyperbolic cosine of the specified value

returns hyperbolic tangent of the specified value

returns the square root of the specified number

returns the cube root of the specified number

returns first argument raised to power of second

subtracts the specified numbers and returns it

multiplies the specified numbers and returns it

adds 1 to the specified number and returns it

subtracts 1 from specified number and returns it

negates the specified variable and returns it

returns the int value from specified long argument

returns the smaller value among the arguments

returns the maximum value among the arguments

rounds the specified value upward

rounds the specified value downward and returns it

rounds the specified argument and returns it

converts angle from degree to radians

converts angle from radians to degrees

returns θ converting coordinates (x, y) to (r, θ)

copies the sign of second argument to the first

returns e raised to power of given value

returns e raised to power of given value minus 1

returns the unbiased exponent of specified number

computes the hypotenuse of a right-angle triangle

returns the remainder as per the IEEE 754 standard

returns the natural logarithm of specified value

returns the base 10 logarithm of specified value

returns natural logarithm of (specified value + 1)

returns number adjacent to specified number

returns number greater than and adjacent to value

returns number less than and adjacent to the value

returns closest mathematical integer of the vaue

returns a random value between 0.0 and 1.0