public class MathFunctions extends Object
| Constructor and Description |
|---|
MathFunctions(ExpressionContext expressionContext)
Default constructor
|
| Modifier and Type | Method and Description |
|---|---|
static Double |
abs(Double value)
Returns the absolute value
|
static Long |
abs(Long value) |
static Double |
acos(Number value)
Returns the trigonometric arc cosine of an angle
|
static Double |
asin(Number value)
Returns the trigonometric arc sine of an angle
|
static Double |
atan(Number value)
Returns the trigonometric arc tangent of an angle
|
static Double |
atan2(Number y,
Number x)
Converts rectangular coordinates (
x , y) to polar (r, theta ). |
static Double |
ceil(Number value)
Returns the smallest (closest to negative infinity)
double value that is greater than or equal to
the argument and is equal to a
mathematical integer. |
static Double |
cos(Number value)
Returns the trigonometric cosine of an angle
|
static Double |
exp(Number value)
Returns Euler's number e raised to the power of a
double value. |
static Double |
floor(Number value)
Returns the largest (closest to positive infinity)
double value that is less than or equal to the
argument and is equal to a
mathematical integer. |
static Double |
log(Number value)
Returns the natural logarithm (base e ) of a
double value. |
static Double |
max(Double value1,
Double value2)
Returns the maximum of two numbers.
|
static Long |
max(Long value1,
Long value2)
Returns the maximum of two numbers.
|
static Double |
min(Double value1,
Double value2)
Returns the minimum of two numbers.
|
static Long |
min(Long value1,
Long value2)
Returns the minimum of two numbers.
|
static Double |
pow(Number base,
Number exponent)
Computes the power
|
static Double |
random()
Returns a
double value with a positive sign, greater than
or equal to 0.0 and less than 1.0. |
static Double |
rint(Double value)
Returns the
double value that is closest in value to the
argument and is equal to a mathematical integer. |
static Long |
round(Double value)
Returns the closest
int to the argument. |
static Double |
sin(Number value)
Returns the trigonometric sine of an angle
|
static Double |
sqrt(Number value)
Returns the correctly rounded positive square root of a
double value. |
Double |
sum(Double[] vals) |
static Double |
tan(Number value)
Returns the trigonometric tangent of an angle
|
public MathFunctions(ExpressionContext expressionContext)
public static Double min(Double value1, Double value2)
value1 - value2 - public static Long min(Long value1, Long value2)
value1 - value2 - public static Double max(Double value1, Double value2)
value1 - value2 - public static Long max(Long value1, Long value2)
value1 - value2 - public static Double sin(Number value)
value - public static Double cos(Number value)
value - public static Double tan(Number value)
value - public static Double asin(Number value)
value - public static Double acos(Number value)
value - public static Double atan(Number value)
value - public static Double atan2(Number y, Number x)
x , y) to polar (r, theta ).y - x - public static Double exp(Number value)
double value. Special cases:value - the exponent to raise e to.public static Double pow(Number base, Number exponent)
base - exponent - public static Double log(Number value)
double value.value - a valuea, the natural logarithm of a.public static Double sqrt(Number value)
double value.value - a value.a. If the argument is
NaN or less than zero, the result is NaN.public static Double ceil(Number value)
double value that is greater than or equal to
the argument and is equal to a
mathematical integer.a - a value.public static Double floor(Number value)
double value that is less than or equal to the
argument and is equal to a
mathematical integer.value - a value.public static Double rint(Double value)
double value that is closest in value to the
argument and is equal to a mathematical integer. If two double values that are mathematical integers
are equally
close, the result is the integer value that is even.value - a double value.public static Long round(Double value)
int to the argument. The result is
rounded to an integer by adding 1/2, taking the floor of the result, and
casting the result to type int. In other words, the
result is equal to the value of the expression:
(int) Math.floor( a + 0.5f )
a - a floating-point value to be rounded to an integer.int value.public static Double random()
double value with a positive sign, greater than
or equal to 0.0 and less than 1.0.
Returned values are chosen pseudorandomly with (approximately) uniform
distribution from that range.double greater than or equal to 0.0 and less than
1.0.