Module : math

Version : 1.0.0

Module Overview

This module provides functions to perform fixed-precision integer arithmetic and fixed-precision decimal arithmetic. It includes functions to get the absolute, cosine, sine, root, tangent, and more for a given value.

For information on the operation, which you can perform with this module, see the below Function. For examples on the usage of the operation, see Math Api.

Functions

absFloat
I

Calculates the absolute value of a float value.

absInt
I

Calculates the absolute value of an int value.

acos
I

Calculates the arc cosine of a value; the returned angle is in the range 0.0 through pi.

asin
I

Calculates the arc sine of a value.

atan
I

Calculates the arc tangent of a value.

atan2
I

Calculates the angle theta from the conversion of rectangular coordinates (a, b) to polar coordinates (r, theta).

cbrt
I

Calculates the cube root of a float value.

ceil
I

Calculates the smallest (closest to negative infinity) double value that is greater than or equal to the argument and is equal to a mathematical integer.

copySign
I

Calculates the first floating-point argument with the sign of the second floating-point argument.

cos
I

Calculates the trigonometric cosine of an angle.

cosh
I

Calculates the hyperbolic cosine of a float value.

exp
I

Calculates Euler's number, that is 'e' raised to the power of exponent.

expm1
I

Calculates (e to the power of x) -1.

floor
I

Calculates the largest (closest to positive infinity) float value that is less than or equal to the argument and is equal to a mathematical integer.

floorDiv
I

Calculates the largest (closest to positive infinity) int value that is less than or equal to the algebraic quotient.

floorMod
I

Calculates the floor modulus of the long arguments.

getExponent
I

Calculates the unbiased exponent used in the representation of a float.

hypot
I

Calculates sqrt(a squared +b squared) without intermediate overflow or underflow.

log
I

Calculates the natural logarithm (base e) of a float value.

log10
I

Calculates the base 10 logarithm of a float value.

log1p
I

Calculates the natural logarithm of the sum of the argument and 1.

negateExact
I

Calculates the negation of the argument.

nextAfter
I

Calculates the floating-point number adjacent to the first argument in the direction of the second argument.

nextDown
I

Calculates the adjacent floating-point value closer to negative infinity.

nextUp
I

Calculates the adjacent floating-point value closer to positive infinity.

pow
I

Calculates the value of the 'a' raised to the power of 'b'.

random
I

Selects a random number between 0.0 and 1.0.

randomInRange
I

Selects a random number between the given start(inclusive) and end(exclusive) values.

remainder
I

Computes the remainder operation on two arguments as prescribed by the IEEE 754 standard.

rint
I

Calculates the double value that is closest in value to the argument and is equal to a mathematical integer.

round
I

Calculates the closest int to the argument, with ties rounding to positive infinity.

scalb
I

Calculates a × (2 to the power of b) rounded as if performed by a single correctly rounded floating-point multiply to a member of the float value set.

signum
I

Calculates the signum function of the argument.

sin
I

Calculates the trigonometric sine of an angle.

sinh
I

Calculates the hyperbolic sine of a float value.

sqrt
I

Calculates rounded positive square root of the given value.

tan
I

Calculates the trigonometric tangent of an angle.

tanh
I

Calculates the hyperbolic tangent of a double value.

toDegrees
I

Converts an angle measured in radians to an approximately equivalent angle measured in degrees.

toRadians
I

Converts an angle measured in degrees to an approximately equivalent angle measured in radians.

ulp
I

Returns the size of an ulp of the argument.

Constants

PI

Ratio of the circumference of a circle to its diameter.

E

Base of the natural logarithms.

Types

Error

The union of all the Math related errors

Errors

ArithmeticError

Represents an error occurred in the math operation.