java.lang.Object
com.pervasive.datarush.functions.Math
Provides implementations of common math functions found in the
Math library.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ScalarValuedFunctionabs(ScalarValuedFunction expr) Returns the absolute value of the given expression.static ScalarValuedFunctionReturns the absolute value of the given field.static ScalarValuedFunctionacos(ScalarValuedFunction expr) Returns the arc cosine of the given expression using radians.static ScalarValuedFunctionReturns the arc cosine of the given field using radians.static ScalarValuedFunctionasin(ScalarValuedFunction expr) Returns the arc sine of the given expression using radians.static ScalarValuedFunctionReturns the arc sine of the given field using radians.static ScalarValuedFunctionatan(ScalarValuedFunction expr) Returns the arc tangent of the given expression using radians.static ScalarValuedFunctionReturns the arc tangent of the given field using radians.static ScalarValuedFunctionReturns the angle theta from the conversion of rectangular coordinates (x,y) to polar coordinates (r, theta).static ScalarValuedFunctionReturns the angle theta from the conversion of rectangular coordinates (x,y) to polar coordinates (r, theta).static ScalarValuedFunctioncbrt(ScalarValuedFunction expr) Returns the cube root of the given expression.static ScalarValuedFunctionReturns the cube root of the given field.static ScalarValuedFunctionceil(ScalarValuedFunction expr) Returns the ceiling of the given expression.static ScalarValuedFunctionReturns the ceiling of the given field.static ScalarValuedFunctioncopySign(ScalarValuedFunction magnitude, ScalarValuedFunction sign) Returnsmagnitudewith the sign ofsign.static ScalarValuedFunctionReturnsmagnitudewith the sign ofsign.static ScalarValuedFunctioncos(ScalarValuedFunction expr) Returns the cosine of the given expression using radians.static ScalarValuedFunctionReturns the cosine of the given field using radians.static ScalarValuedFunctioncosh(ScalarValuedFunction expr) Returns the hyperbolic cosine of the given expression using radians.static ScalarValuedFunctionReturns the hyperbolic cosine of the given field using radians.static ScalarValuedFunctione()Returns the constant value e.static ScalarValuedFunctionexp(ScalarValuedFunction expr) Returns e raised to the power of the given expression.static ScalarValuedFunctionReturns e raised to the power of the given field.static ScalarValuedFunctionexpm1(ScalarValuedFunction expr) Returns e raised to the power of the given expression minus 1.static ScalarValuedFunctionReturns e raised to the power of the given field minus 1.static ScalarValuedFunctionfloor(ScalarValuedFunction expr) Returns the floor of the given expression.static ScalarValuedFunctionReturns the floor of the given field.static ScalarValuedFunctionReturns the unbiased exponent used in the representation of a double or float.static ScalarValuedFunctiongetExponent(String field) Returns the unbiased exponent used in the representation of a double or float.static ScalarValuedFunctionReturns sqrt(x2 + y2) without intermediate overflow or underflow.static ScalarValuedFunctionReturns sqrt(x2 + y2) without intermediate overflow or underflow.static ScalarValuedFunctionIEEEremainder(ScalarValuedFunction dividend, ScalarValuedFunction divisor) Returns the IEEE 754 standard remainder.static ScalarValuedFunctionIEEEremainder(String dividend, String divisor) Returns the IEEE 754 standard remainder.static ScalarValuedFunctionlog(ScalarValuedFunction expr) Returns the natural logarithm of the given expression.static ScalarValuedFunctionReturns the natural logarithm of the given field.static ScalarValuedFunctionlog10(ScalarValuedFunction expr) Returns the base 10 logarithm of the given expression.static ScalarValuedFunctionReturns the base 10 logarithm of the given field.static ScalarValuedFunctionlog1p(ScalarValuedFunction expr) Returns the natural logarithm of 1 plus the given expression.static ScalarValuedFunctionReturns the natural logarithm of 1 plus the given field.static ScalarValuedFunctionReturns the maximum of the argument values.static ScalarValuedFunctionmax(List<ScalarValuedFunction> exprs) Returns the maximum of the argument values.static ScalarValuedFunctionmaxNotNull(String... fields) Returns the maximum of the argument values, ignoring null values.static ScalarValuedFunctionmaxNotNull(List<ScalarValuedFunction> exprs) Returns the maximum of the argument values, ignoring null values.static ScalarValuedFunctionReturns the minimum of the argument values.static ScalarValuedFunctionmin(List<ScalarValuedFunction> exprs) Returns the minimum of the argument values.static ScalarValuedFunctionminNotNull(String... fields) Returns the minimum of the argument values, ignoring null values.static ScalarValuedFunctionminNotNull(List<ScalarValuedFunction> exprs) Returns the minimum of the argument values, ignoring null values.static ScalarValuedFunctionnextAfter(ScalarValuedFunction start, ScalarValuedFunction direction) Returns the floating point number adjacent to the first argument in the direction of the second argument.static ScalarValuedFunctionReturns the floating point number adjacent to the first argument in the direction of the second argument.static ScalarValuedFunctionnextUp(ScalarValuedFunction start) Returns the floating point number adjacent to the argument in the direction of positive infinity.static ScalarValuedFunctionReturns the floating point number adjacent to the argument in the direction of positive infinity.static ScalarValuedFunctionpi()Returns the constant value pi.static ScalarValuedFunctionpow(ScalarValuedFunction base, ScalarValuedFunction exponent) Returnsbaseraised to theexponentpower.static ScalarValuedFunctionReturnsbaseraised to theexponentpower.static ScalarValuedFunctionReturn the precision of the given expression.static ScalarValuedFunctionReturns the precision of the field.static ScalarValuedFunctionrandom()Returns a random double value greater than or equal to 0 and less than 1.static ScalarValuedFunctionrint(ScalarValuedFunction expr) Returns the double value closest to the given expression and equal to a mathematical integer.static ScalarValuedFunctionReturns the double value closest to the given field and equal to a mathematical integer.static ScalarValuedFunctionround(ScalarValuedFunction expr) Returns the expression rounded to the nearest whole number.static ScalarValuedFunctionReturns the expression rounded to the nearest whole number.static ScalarValuedFunctionscalb(ScalarValuedFunction expr, ScalarValuedFunction scaleFactor) Returnsexpr× 2scaleFactorrounded as if performed by a single correctly rounded floating-point multiply to a member of the double or float value set.static ScalarValuedFunctionReturnsexpr× 2scaleFactorrounded as if performed by a single correctly rounded floating-point multiply to a member of the double or float value set.static ScalarValuedFunctionscale(ScalarValuedFunction expr) Return the scale of the given expression.static ScalarValuedFunctionReturns the scale of the field.static ScalarValuedFunctionsignum(ScalarValuedFunction expr) Returns the signum function of the expression: 0 if the expression is zero, 1 if it is greater than zero, or -1 if it is less than 0.static ScalarValuedFunctionReturns the signum function of the expression: 0 if the expression is zero, 1 if it is greater than zero, or -1 if it is less than 0.static ScalarValuedFunctionsin(ScalarValuedFunction expr) Returns the sine of the given expression using radians.static ScalarValuedFunctionReturns the sine of the given field using radians.static ScalarValuedFunctionsinh(ScalarValuedFunction expr) Returns the hyperbolic sine of the given expression using radians.static ScalarValuedFunctionReturns the hyperbolic sine of the given field using radians.static ScalarValuedFunctionsqrt(ScalarValuedFunction expr) Returns the square root of the given expression.static ScalarValuedFunctionReturns the square root of the given field.static ScalarValuedFunctiontan(ScalarValuedFunction expr) Returns the tangent of the given expression using radians.static ScalarValuedFunctionReturns the tangent of the given field using radians.static ScalarValuedFunctiontanh(ScalarValuedFunction expr) Returns the hyperbolic tangent of the given expression using radians.static ScalarValuedFunctionReturns the hyperbolic tangent of the given field using radians.static ScalarValuedFunctionReturns the radian expression in degrees.static ScalarValuedFunctionReturns the radian expression in degrees.static ScalarValuedFunctionReturns the degree expression in radians.static ScalarValuedFunctionReturns the degree expression in radians.static ScalarValuedFunctionulp(ScalarValuedFunction expr) Returns the size of an ulp of the expression.static ScalarValuedFunctionReturns the size of an ulp of the expression.
-
Constructor Details
-
Math
public Math()
-
-
Method Details
-
abs
Returns the absolute value of the given field.- Parameters:
field- the field containing a numeric expression- Returns:
- a function that computes the absolute value
-
abs
Returns the absolute value of the given expression.- Parameters:
expr- the numeric expression- Returns:
- a function that computes the absolute value
-
acos
Returns the arc cosine of the given field using radians.- Parameters:
field- the field containing a numeric expression- Returns:
- a function that computes the arc cosine
-
acos
Returns the arc cosine of the given expression using radians.- Parameters:
expr- the numeric expression- Returns:
- a function that computes the arc cosine
-
asin
Returns the arc sine of the given field using radians.- Parameters:
field- the field containing a numeric expression- Returns:
- a function that computes the arc sine
-
asin
Returns the arc sine of the given expression using radians.- Parameters:
expr- the numeric expression- Returns:
- a function that computes the arc sine
-
atan
Returns the arc tangent of the given field using radians.- Parameters:
field- the field containing a numeric expression- Returns:
- a function that computes the arc tangent
-
atan
Returns the arc tangent of the given expression using radians.- Parameters:
expr- the numeric expression- Returns:
- a function that computes the arc tangent
-
atan2
Returns the angle theta from the conversion of rectangular coordinates (x,y) to polar coordinates (r, theta).- Parameters:
y- the field containing a numeric expression yx- the field containing a numeric expression x- Returns:
- a function that computes theta
-
atan2
Returns the angle theta from the conversion of rectangular coordinates (x,y) to polar coordinates (r, theta).- Parameters:
y- the numeric expression yx- the numeric expression x- Returns:
- a function that computes theta
-
cbrt
Returns the cube root of the given field.- Parameters:
field- the field containing a numeric expression- Returns:
- a function that computes the cube root
-
cbrt
Returns the cube root of the given expression.- Parameters:
expr- the numeric expression- Returns:
- a function that computes the cube root
-
ceil
Returns the ceiling of the given field.- Parameters:
field- the field containing a numeric expression- Returns:
- a function that computes the ceiling
-
ceil
Returns the ceiling of the given expression.- Parameters:
expr- the numeric expression- Returns:
- a function that computes the ceiling
-
copySign
Returnsmagnitudewith the sign ofsign.- Parameters:
magnitude- a field containing a numeric expressionsign- a field containing a numeric expression- Returns:
- a function that returns magnitude with the sign of sign
-
copySign
public static ScalarValuedFunction copySign(ScalarValuedFunction magnitude, ScalarValuedFunction sign) Returnsmagnitudewith the sign ofsign.- Parameters:
magnitude- a numeric expressionsign- a numeric expression- Returns:
- a function that returns magnitude with the sign of sign
-
cos
Returns the cosine of the given field using radians.- Parameters:
field- the field containing a numeric expression- Returns:
- a function that computes the cosine
-
cos
Returns the cosine of the given expression using radians.- Parameters:
expr- the numeric expression- Returns:
- a function that computes the cosine
-
cosh
Returns the hyperbolic cosine of the given field using radians.- Parameters:
field- the field containing a numeric expression- Returns:
- a function that computes the hyperbolic cosine
-
cosh
Returns the hyperbolic cosine of the given expression using radians.- Parameters:
expr- the numeric expression- Returns:
- a function that computes the hyperbolic cosine
-
e
Returns the constant value e.- Returns:
- a constant reference to the double value e
-
exp
Returns e raised to the power of the given field.- Parameters:
field- the field containing a numeric expression- Returns:
- a function that computes e raised to a power
-
exp
Returns e raised to the power of the given expression.- Parameters:
expr- the numeric expression- Returns:
- a function that computes e raised to a power
-
expm1
Returns e raised to the power of the given field minus 1.- Parameters:
field- the field containing a numeric expression- Returns:
- a function that computes e raised to a power minus 1
-
expm1
Returns e raised to the power of the given expression minus 1.- Parameters:
expr- the numeric expression- Returns:
- a function that computes e raised to a power minus 1
-
floor
Returns the floor of the given field.- Parameters:
field- the field containing a numeric expression- Returns:
- a function that computes the floor
-
floor
Returns the floor of the given expression.- Parameters:
expr- the numeric expression- Returns:
- a function that computes the floor
-
getExponent
Returns the unbiased exponent used in the representation of a double or float.- Parameters:
field- the field containing a double or float value- Returns:
- a function that computes the unbiased exponent used in the representation of a double or float
-
getExponent
Returns the unbiased exponent used in the representation of a double or float.- Parameters:
field- a double or float value- Returns:
- a function that computes the unbiased exponent used in the representation of a double or float
-
hypot
Returns sqrt(x2 + y2) without intermediate overflow or underflow.- Parameters:
x- the field containing a numeric expression xy- the field containing a numeric expression y- Returns:
- a function that computes sqrt(x2 + y2)
-
hypot
Returns sqrt(x2 + y2) without intermediate overflow or underflow.- Parameters:
x- the numeric expression xy- the numeric expression y- Returns:
- a function that computes sqrt(x2 + y2)
-
IEEEremainder
Returns the IEEE 754 standard remainder.- Parameters:
dividend- the field containing the dividend numeric expressiondivisor- the field containing the divisor numeric expression- Returns:
- a function that computes the remainder
-
IEEEremainder
public static ScalarValuedFunction IEEEremainder(ScalarValuedFunction dividend, ScalarValuedFunction divisor) Returns the IEEE 754 standard remainder.- Parameters:
dividend- the dividend numeric expressiondivisor- the divisor numeric expression- Returns:
- a function that computes the remainder
-
log
Returns the natural logarithm of the given field.- Parameters:
field- the field containing a numeric expression- Returns:
- a function that computes the natural logarithm
-
log
Returns the natural logarithm of the given expression.- Parameters:
expr- the numeric expression- Returns:
- a function that computes the natural logarithm
-
log10
Returns the base 10 logarithm of the given field.- Parameters:
field- the field containing a numeric expression- Returns:
- a function that computes the base 10 logarithm
-
log10
Returns the base 10 logarithm of the given expression.- Parameters:
expr- the numeric expression- Returns:
- a function that computes the base 10 logarithm
-
log1p
Returns the natural logarithm of 1 plus the given field.- Parameters:
field- the field containing a numeric expression- Returns:
- a function that computes the natural logarithm of 1 plus a value
-
log1p
Returns the natural logarithm of 1 plus the given expression.- Parameters:
expr- the numeric expression- Returns:
- a function that computes the natural logarithm of 1 plus a value
-
max
Returns the maximum of the argument values. If any value is null, the result will be null.- Parameters:
fields- the fields containing the first expressions- Returns:
- a function that returns the max
-
max
Returns the maximum of the argument values. If any value is null, the result will be null.- Parameters:
exprs- the numeric expressions- Returns:
- a function that returns the max
-
maxNotNull
Returns the maximum of the argument values, ignoring null values.- Parameters:
fields- the fields containing the first expressions- Returns:
- a function that returns the max
-
maxNotNull
Returns the maximum of the argument values, ignoring null values.- Parameters:
exprs- the numeric expressions- Returns:
- a function that returns the max
-
min
Returns the minimum of the argument values. If any value is null, the result will be null.- Parameters:
fields- the fields containing the numeric expressions- Returns:
- a function that returns the min
-
min
Returns the minimum of the argument values. If any value is null, the result will be null.- Parameters:
exprs- the numeric expressions- Returns:
- a function that returns the min
-
minNotNull
Returns the minimum of the argument values, ignoring null values.- Parameters:
fields- the fields containing the numeric expressions- Returns:
- a function that returns the min
-
minNotNull
Returns the minimum of the argument values, ignoring null values.- Parameters:
exprs- the numeric expressions- Returns:
- a function that returns the min
-
nextAfter
Returns the floating point number adjacent to the first argument in the direction of the second argument.- Parameters:
start- the field containing the start expressiondirection- the field containing the direction expression- Returns:
- a function that returns the next floating point number
-
nextAfter
public static ScalarValuedFunction nextAfter(ScalarValuedFunction start, ScalarValuedFunction direction) Returns the floating point number adjacent to the first argument in the direction of the second argument.- Parameters:
start- the start expressiondirection- the direction expression- Returns:
- a function that returns the next floating point number
-
nextUp
Returns the floating point number adjacent to the argument in the direction of positive infinity.- Parameters:
start- the field containing the start expression- Returns:
- a function that returns the next floating point number
-
nextUp
Returns the floating point number adjacent to the argument in the direction of positive infinity.- Parameters:
start- the start expression- Returns:
- a function that returns the next floating point number
-
pi
Returns the constant value pi.- Returns:
- a constant reference to the double value pi
-
pow
Returnsbaseraised to theexponentpower.- Parameters:
base- the field containing the base numeric expressionexponent- the field containing the exponent numeric expression- Returns:
- a function that computes
baseexponent
-
pow
Returnsbaseraised to theexponentpower.- Parameters:
base- the base numeric expressionexponent- the exponent numeric expression- Returns:
- a function that computes
baseexponent
-
precision
Returns the precision of the field.- Parameters:
field- the field containing the numeric expression- Returns:
- a function that returns the precision
-
precision
Return the precision of the given expression.- Parameters:
expr- the numeric expression- Returns:
- a function that returns the precision
-
random
Returns a random double value greater than or equal to 0 and less than 1.- Returns:
- a function that returns a random value
-
rint
Returns the double value closest to the given field and equal to a mathematical integer.- Parameters:
field- the field containing a numeric expression- Returns:
- a function that rounds
-
rint
Returns the double value closest to the given expression and equal to a mathematical integer.- Parameters:
expr- the numeric expression- Returns:
- a function that rounds
-
round
Returns the expression rounded to the nearest whole number.- Parameters:
field- the field containing the numeric expression- Returns:
- a function that rounds
-
round
Returns the expression rounded to the nearest whole number.- Parameters:
start- the numeric expression- Returns:
- a function that rounds
-
scalb
Returnsexpr× 2scaleFactorrounded as if performed by a single correctly rounded floating-point multiply to a member of the double or float value set.- Parameters:
expr- the field containing the base expressionscaleFactor- the field containing the scale factor- Returns:
- a function that returns
expr× 2scaleFactor
-
scalb
public static ScalarValuedFunction scalb(ScalarValuedFunction expr, ScalarValuedFunction scaleFactor) Returnsexpr× 2scaleFactorrounded as if performed by a single correctly rounded floating-point multiply to a member of the double or float value set.- Parameters:
expr- the base expressionscaleFactor- the scale factor- Returns:
- a function that returns
expr× 2scaleFactor
-
scale
Returns the scale of the field.- Parameters:
field- the field containing the numeric expression- Returns:
- a function that returns the scale
-
scale
Return the scale of the given expression.- Parameters:
expr- the numeric expression- Returns:
- a function that returns the scale
-
signum
Returns the signum function of the expression: 0 if the expression is zero, 1 if it is greater than zero, or -1 if it is less than 0.- Parameters:
field- the field containing the numeric expression- Returns:
- a function that returns the signum function
-
signum
Returns the signum function of the expression: 0 if the expression is zero, 1 if it is greater than zero, or -1 if it is less than 0.- Parameters:
expr- the numeric expression- Returns:
- a function that returns the signum function
-
sin
Returns the sine of the given field using radians.- Parameters:
field- the field containing a numeric expression- Returns:
- a function that computes the sine
-
sin
Returns the sine of the given expression using radians.- Parameters:
expr- the numeric expression- Returns:
- a function that computes the sine
-
sinh
Returns the hyperbolic sine of the given field using radians.- Parameters:
field- the field containing a numeric expression- Returns:
- a function that computes the hyperbolic sine
-
sinh
Returns the hyperbolic sine of the given expression using radians.- Parameters:
expr- the numeric expression- Returns:
- a function that computes the hyperbolic sine
-
sqrt
Returns the square root of the given field.- Parameters:
field- the field containing a numeric expression- Returns:
- a function that computes the square root
-
sqrt
Returns the square root of the given expression.- Parameters:
expr- the numeric expression- Returns:
- a function that computes the square root
-
tan
Returns the tangent of the given field using radians.- Parameters:
field- the field containing a numeric expression- Returns:
- a function that computes the tangent
-
tan
Returns the tangent of the given expression using radians.- Parameters:
expr- the numeric expression- Returns:
- a function that computes the tangent
-
tanh
Returns the hyperbolic tangent of the given field using radians.- Parameters:
field- the field containing a numeric expression- Returns:
- a function that computes the hyperbolic tangent
-
tanh
Returns the hyperbolic tangent of the given expression using radians.- Parameters:
expr- the numeric expression- Returns:
- a function that computes the hyperbolic tangent
-
toDegrees
Returns the radian expression in degrees.- Parameters:
field- the field containing a numeric expression- Returns:
- a function that converts radians to degrees
-
toDegrees
Returns the radian expression in degrees.- Parameters:
expr- the numeric expression- Returns:
- a function that converts radians to degrees
-
toRadians
Returns the degree expression in radians.- Parameters:
field- the field containing a numeric expression- Returns:
- a function that converts degrees to radians
-
toRadians
Returns the degree expression in radians.- Parameters:
expr- the numeric expression- Returns:
- a function that converts degrees to radians
-
ulp
Returns the size of an ulp of the expression.- Parameters:
field- the field containing the numeric expression- Returns:
- a function that returns the ulp size
-
ulp
Returns the size of an ulp of the expression.- Parameters:
expr- the numeric expression- Returns:
- a function that returns the ulp size
-