//ERDDAP/com.cohort.util/ScriptMath
ScriptMath
[JVM]
open class ScriptMath
This class makes almost all of the static methods in java.lang.Math accessible to JexlScript scripts as "Math.name()" methods.
Author
Bob Simons (was bob.simons@noaa.gov, now BobSimons2.00@gmail.com) 2019-11-14
Constructors
ScriptMath | [JVM] constructor() |
Properties
Name | Summary |
---|---|
E | [JVM] val E: Double = 2.718281828459045 The double value that is closer than any other to e, the base of the natural logarithms. |
PI | [JVM] val PI: Double = 3.141592653589793 The double value that is closer than any other to pi, the ratio of the circumference of a circle to its diameter. |
Functions
Name | Summary |
---|---|
abs | [JVM] open fun abs(a: Double): Double Returns the absolute value of a double value. [JVM] open fun abs(a: Float): Float Returns the absolute value of a float value. [JVM] open fun abs(a: Int): Int Returns the absolute value of an int value. [JVM] open fun abs(a: Long): Long Returns the absolute value of a long value. |
acos | [JVM] open fun acos(a: Double): Double Returns the arc cosine of a value; the returned angle is in the range 0.0 through pi. |
addExact | [JVM] open fun addExact(x: Int, y: Int): Int Returns the sum of its arguments, throwing an exception if the result overflows an int. [JVM] open fun addExact(x: Long, y: Long): Long Returns the sum of its arguments, throwing an exception if the result overflows a long. |
asin | [JVM] open fun asin(a: Double): Double Returns the arc sine of a value; the returned angle is in the range -pi/2 through pi/2. |
atan | [JVM] open fun atan(a: Double): Double Returns the arc tangent of a value; the returned angle is in the range -pi/2 through pi/2. |
atan2 | [JVM] open fun atan2(y: Double, x: Double): Double Returns the angle theta from the conversion of rectangular coordinates (x, y) to polar coordinates (r, theta). |
cbrt | [JVM] open fun cbrt(a: Double): Double Returns the cube root of a double value. |
ceil | [JVM] open fun ceil(a: Double): Double 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. |
copySign | [JVM] open fun copySign(magnitude: Double, sign: Double): Double open fun copySign(magnitude: Float, sign: Float): Float Returns the first floating-point argument with the sign of the second floating-point argument. |
cos | [JVM] open fun cos(a: Double): Double Returns the trigonometric cosine of an angle. |
cosh | [JVM] open fun cosh(x: Double): Double Returns the hyperbolic cosine of a double value. |
decrementExact | [JVM] open fun decrementExact(a: Int): Int Returns the argument decremented by one, throwing an exception if the result overflows an int. [JVM] open fun decrementExact(a: Long): Long Returns the argument decremented by one, throwing an exception if the result overflows a long. |
exp | [JVM] open fun exp(a: Double): Double Returns Euler's number e raised to the power of a double value. |
expm1 | [JVM] open fun expm1(x: Double): Double Returns ex -1. |
floor | [JVM] open fun floor(a: Double): Double 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. |
floorDiv | [JVM] open fun floorDiv(x: Int, y: Int): Int Returns the largest (closest to positive infinity) int value that is less than or equal to the algebraic quotient. [JVM] open fun floorDiv(x: Long, y: Long): Long Returns the largest (closest to positive infinity) long value that is less than or equal to the algebraic quotient. |
floorMod | [JVM] open fun floorMod(x: Int, y: Int): Int Returns the floor modulus of the int arguments. [JVM] open fun floorMod(x: Long, y: Long): Long Returns the floor modulus of the long arguments. |
getExponent | [JVM] open fun getExponent(d: Double): Int Returns the unbiased exponent used in the representation of a double. [JVM] open fun getExponent(f: Float): Int Returns the unbiased exponent used in the representation of a float. |
hypot | [JVM] open fun hypot(x: Double, y: Double): Double Returns sqrt(x2 +y2) without intermediate overflow or underflow. |
IEEEremainder | [JVM] open fun IEEEremainder(f1: Double, f2: Double): Double Computes the remainder operation on two arguments as prescribed by the IEEE 754 standard. |
incrementExact | [JVM] open fun incrementExact(a: Int): Int Returns the argument incremented by one, throwing an exception if the result overflows an int. [JVM] open fun incrementExact(a: Long): Long Returns the argument incremented by one, throwing an exception if the result overflows a long. |
log | [JVM] open fun log(a: Double): Double Returns the natural logarithm (base e) of a double value. |
log10 | [JVM] open fun log10(a: Double): Double Returns the base 10 logarithm of a double value. |
log1p | [JVM] open fun log1p(x: Double): Double Returns the natural logarithm of the sum of the argument and 1. |
max | [JVM] open fun max(a: Double, b: Double): Double Returns the greater of two double values. [JVM] open fun max(a: Float, b: Float): Float Returns the greater of two float values. [JVM] open fun max(a: Int, b: Int): Int Returns the greater of two int values. [JVM] open fun max(a: Long, b: Long): Long Returns the greater of two long values. |
min | [JVM] open fun min(a: Double, b: Double): Double Returns the smaller of two double values. [JVM] open fun min(a: Float, b: Float): Float Returns the smaller of two float values. [JVM] open fun min(a: Int, b: Int): Int Returns the smaller of two int values. [JVM] open fun min(a: Long, b: Long): Long Returns the smaller of two long values. |
multiplyExact | [JVM] open fun multiplyExact(x: Int, y: Int): Int Returns the product of the arguments, throwing an exception if the result overflows an int. [JVM] open fun multiplyExact(x: Long, y: Long): Long Returns the product of the arguments, throwing an exception if the result overflows a long. |
negateExact | [JVM] open fun negateExact(a: Int): Int Returns the negation of the argument, throwing an exception if the result overflows an int. [JVM] open fun negateExact(a: Long): Long Returns the negation of the argument, throwing an exception if the result overflows a long. |
nextAfter | [JVM] open fun nextAfter(start: Double, direction: Double): Double open fun nextAfter(start: Float, direction: Double): Float Returns the floating-point number adjacent to the first argument in the direction of the second argument. |
nextDown | [JVM] open fun nextDown(d: Double): Double Returns the floating-point value adjacent to d in the direction of negative infinity. [JVM] open fun nextDown(f: Float): Float Returns the floating-point value adjacent to f in the direction of negative infinity. |
nextUp | [JVM] open fun nextUp(d: Double): Double Returns the floating-point value adjacent to d in the direction of positive infinity. [JVM] open fun nextUp(f: Float): Float Returns the floating-point value adjacent to f in the direction of positive infinity. |
pow | [JVM] open fun pow(a: Double, b: Double): Double Returns the value of the first argument raised to the power of the second argument. |
random | [JVM] open fun random(): Double Returns a double value with a positive sign, greater than or equal to 0.0 and less than 1.0. |
rint | [JVM] open fun rint(a: Double): Double Returns the double value that is closest in value to the argument and is equal to a mathematical integer. |
round | [JVM] open fun round(a: Double): Long Returns the closest long to the argument, with ties rounding to positive infinity. [JVM] open fun round(a: Float): Int Returns the closest int to the argument, with ties rounding to positive infinity. |
scalb | [JVM] open fun scalb(d: Double, scaleFactor: Int): Double Returns d × 2scaleFactor rounded as if performed by a single correctly rounded floating-point multiply to a member of the double value set. [JVM] open fun scalb(f: Float, scaleFactor: Int): Float Returns f × 2scaleFactor rounded as if performed by a single correctly rounded floating-point multiply to a member of the float value set. |
signum | [JVM] open fun signum(d: Double): Double Returns the signum function of the argument; zero if the argument is zero, 1.0 if the argument is greater than zero, -1.0 if the argument is less than zero. [JVM] open fun signum(f: Float): Float Returns the signum function of the argument; zero if the argument is zero, 1.0f if the argument is greater than zero, -1.0f if the argument is less than zero. |
sin | [JVM] open fun sin(a: Double): Double Returns the trigonometric sine of an angle. |
sinh | [JVM] open fun sinh(x: Double): Double Returns the hyperbolic sine of a double value. |
sqrt | [JVM] open fun sqrt(a: Double): Double Returns the correctly rounded positive square root of a double value. |
subtractExact | [JVM] open fun subtractExact(x: Int, y: Int): Int Returns the difference of the arguments, throwing an exception if the result overflows an int. [JVM] open fun subtractExact(x: Long, y: Long): Long Returns the difference of the arguments, throwing an exception if the result overflows a long. |
tan | [JVM] open fun tan(a: Double): Double Returns the trigonometric tangent of an angle. |
tanh | [JVM] open fun tanh(x: Double): Double Returns the hyperbolic tangent of a double value. |
toDegrees | [JVM] open fun toDegrees(angrad: Double): Double Converts an angle measured in radians to an approximately equivalent angle measured in degrees. |
toIntExact | [JVM] open fun toIntExact(value: Long): Int Returns the value of the long argument; throwing an exception if the value overflows an int. |
toRadians | [JVM] open fun toRadians(angdeg: Double): Double Converts an angle measured in degrees to an approximately equivalent angle measured in radians. |
ulp | [JVM] open fun ulp(d: Double): Double open fun ulp(f: Float): Float Returns the size of an ulp of the argument. |