0% found this document useful (0 votes)
10 views5 pages

All Math Methods

The document provides a comprehensive list of mathematical methods along with their descriptions and return types. Each method, such as abs, acos, and sqrt, serves a specific mathematical function and returns various data types including double, float, int, and long. This serves as a reference for developers needing to utilize mathematical operations in their code.

Uploaded by

luislopez552049
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)
10 views5 pages

All Math Methods

The document provides a comprehensive list of mathematical methods along with their descriptions and return types. Each method, such as abs, acos, and sqrt, serves a specific mathematical function and returns various data types including double, float, int, and long. This serves as a reference for developers needing to utilize mathematical operations in their code.

Uploaded by

luislopez552049
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/ 5

All Math Methods

A list of all Math methods can be found in the table below:

Method Description Return Type

abs(x) Returns the absolute value of x double|float|int|long

acos(x) Returns the arccosine of x, in radians double

addExact(x, y) Returns the sum of x and y int|long

asin(x) Returns the arcsine of x, in radians double

atan(x) Returns the arctangent of x as a double


numeric value between -PI/2 and PI/2
radians

atan2(y,x) Returns the angle theta from the double


conversion of rectangular coordinates
(x, y) to polar coordinates (r, theta).

cbrt(x) Returns the cube root of x double

ceil(x) Returns the value of x rounded up to its double


nearest integer

copySign(x, y) Returns the first floating point x with double|float


the sign of the second floating point y

cos(x) Returns the cosine of x (x is in radians) double

cosh(x) Returns the hyperbolic cosine of a double


double value
decrementExa Returns x-1 int|long
ct(x)

exp(x) Returns the value of Ex double

expm1(x) Returns ex -1 double

floor(x) Returns the value of x rounded down to double


its nearest integer

floorDiv(x, y) Returns the division between x and y int|long


rounded down

floorMod(x, y) Returns the remainder of a division int|long


between x and y where the result of the
division was rounded down

getExponent(x) Returns the unbiased exponent used int


in x

hypot(x, y) Returns sqrt(x2 +y2) without double


intermediate overflow or underflow

IEEEremainder( Computes the remainder operation on double


x, y) x and y as prescribed by the IEEE 754
standard

incrementExac Returns x+1 int|double


t(x)

log(x) Returns the natural logarithm (base E) double


of x

log10(x) Returns the base 10 logarithm of x double


log1p(x) Returns the natural logarithm (base E) double
of the sum of x and 1

max(x, y) Returns the number with the highest double|float|int|long


value

min(x, y) Returns the number with the lowest double|float|int|long


value

multiplyExact(x Returns the result of x multiplied with y int|long


, y)

negateExact(x) Returns the negation of x int|long

nextAfter(x, y) Returns the floating point number double|float


adjacent to x in the direction of y

nextDown(x) Returns the floating point value double|float


adjacent to x in the negative direction

nextUp(x) Returns the floating point value double|float


adjacent to x in the direction of
positive infinity

pow(x, y) Returns the value of x to the power of y double

random() Returns a random number between 0 double


and 1

rint(x) Returns the double value that is double


closest to x and equal to a
mathematical integer
round(x) Returns the value of x rounded to its long|int
nearest integer

scalb(x, y) Returns x multiplied by 2 to the power double|float


of y

signum(x) Returns the sign of x double|float

sin(x) Returns the sine of x (x is in radians) double

sinh(x) Returns the hyperbolic sine of a double


double value

sqrt(x) Returns the square root of x double

subtractExact(x Returns the result of x minus y int|long


, y)

tan(x) Returns the tangent of an angle double

tanh(x) Returns the hyperbolic tangent of a double


double value

toDegrees(x) Converts an angle measured in radians double


to an approx. equivalent angle
measured in degrees

toIntExact(x) Converts a long value to an int int

toRadians(x) Converts an angle measured in double


degrees to an approx. angle measured
in radians
ulp(x) Returns the size of the unit of least double|float
precision (ulp) of x

You might also like