0% found this document useful (0 votes)
2 views2 pages

Java Math Functions Reference

The document provides a reference for Java math functions, detailing general math functions and trigonometric functions. Each function is listed with its return type and a brief description of its purpose. Key functions include absolute value, square root, power, and trigonometric calculations like sine and cosine.

Uploaded by

nitubinodsingh09
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views2 pages

Java Math Functions Reference

The document provides a reference for Java math functions, detailing general math functions and trigonometric functions. Each function is listed with its return type and a brief description of its purpose. Key functions include absolute value, square root, power, and trigonometric calculations like sine and cosine.

Uploaded by

nitubinodsingh09
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Java Math Functions Reference

General Math Functions:

Function Return Type Description

Math.abs(x) Same as input Absolute value

Math.max(a, b) Same as input Maximum of two values

Math.min(a, b) Same as input Minimum of two values

Math.sqrt(x) double Square root

Math.cbrt(x) double Cube root

Math.pow(a, b) double Power a^b

Math.exp(x) double e^x

Math.log(x) double Natural log

Math.log10(x) double Base-10 log

Math.round(x) int/long Nearest whole number

Math.floor(x) double Round down

Math.ceil(x) double Round up

Math.rint(x) double Round to nearest int

Math.random() double Random [0.0, 1.0)

Math.signum(x) Same as input Sign of number

Math.copySign(mag, sign) Same as input Copy sign

Math.toDegrees(x) double Radians to degrees

Math.toRadians(x) double Degrees to radians

Trigonometric Functions:

Function Return Type Description

Math.sin(x) double Sine (radians)

Math.cos(x) double Cosine


Java Math Functions Reference

Math.tan(x) double Tangent

Math.asin(x) double Arc sine

Math.acos(x) double Arc cosine

Math.atan(x) double Arc tangent

Math.atan2(y, x) double Arc tangent y/x

You might also like