math
Version 4.1.1 by WSO2
Category : Siddhi Execution Supported Product Version : SP 4.0.0 SP 4.1.0 SP 4.2.0 SP 4.3.0 SP 4.4.0Summary
The siddhi-execution-math extension is an extension to Siddhi that contains useful mathematical functions to make your siddhi queries more flexible.
Features of math extension
-
Absolute Value function
Returns the absolute value of p1 . This function wraps the java.lang.Math.abs() function. -
acos function
If -1 <= p1 <= 1, this function returns the arc-cosine (inverse cosine) of p1.
If not, it returns NULL. The return value is in radian scale. This function wraps the java.lang.Math.acos()function. -
asin function
If -1 <= p1 <= 1, this function returns the arc-sin (inverse sine) of p1 .
If not, it returns NULL. The return value is in radian scale. This function wraps the java.lang.Math.asin() function. -
atan function
Returns the arc-tangent (inverse tangent) of p1. The return value is in radian scale.
This function wraps the java.lang.Math.atan() function. -
Binary function
Returns a string representation of the integer/long p1 argument as an unsigned integer in base 2.
This function wraps the java.lang.Integer.toBinaryString andjava.lang.Long.toBinaryString methods. -
Ceiling function
Returns the smallest (closest to negative infinity) double value that is greater than or equal to the p1 argument, and is equal to a mathematical integer.
This function wraps the java.lang.Math.ceil() method. -
CopySign function
Returns the magnitude of magnitude with the sign of sign. This function wraps the java.lang.Math.copySign() function. -
cos function
Returns the cosine of p1 (p1 is in radians). This function wraps the java.lang.Math.cos() function. -
cosh function
Returns the hyperbolic cosine of p1 (p1 is in radians). This function wraps the java.lang.Math.cosh() function. -
Cube Root function
Returns the cube-root of p1 (p1 is in radians). This function wraps the java.lang.Math.cbrt() function. -
e function
Returns the java.lang.Math.E constant, which is the closest double value to e (which is the base of the natural logarithms). -
Exponential function
Returns Euler's number e raised to the power of p1. This function wraps the java.lang.Math.exp() function. -
Floor function
This function wraps the java.lang.Math.floor() function that returns the largest (closest to positive infinity) value that is less that or equal to p1 , and is equal to a mathematical integer. -
Get Exponent function
Returns the unbiased exponent used in the representation of p1. This function wraps the java.lang.Math.getExponent() function. -
Hexadecimal function
This function wraps the java.lang.Double.toHexString() function that returns a hexadecimal string representation of p1 . -
Is Infinite function
This function wraps the java.lang.Float.isInfinite() and java.lang.Double.isInfinite() functions that return true if p1 is infinitely large in magnitude, or return false otherwise. -
Is Not A Number function
This function wraps the java.lang.Float.isNaN() and java.lang.Double.isNaN() functions that return true if p1 is a NaN (Not-a-Number) value, or return false otherwise. -
ln function
Returns the natural logarithm (base e) of p1. -
log2 function
Returns the base 2 logarithm of p1. -
log10 function
Returns the base 10 logarithm of p1. -
log function
Returns the logarithm (base=base) of number. -
Max function
Returns the greater value out of p1 and p2. -
Min function
Returns the smaller value out of p1 and p2 . -
Octal function
Converts p1 to octal. -
Parse Double function
Returns str as a double. -
Parse Float function
Returns str as a float. -
Parse Int function
Returns str as an int. -
Parse Long function
Returns str as a long. -
Percentile function
Returns the pth percentile value of the arg values. -
pi function
Returns the java.lang.Math.PI constant, which is the closest value to pi (i.e. the ratio of the circumference of a circle to its diameter). -
Power function
Returns value raised to the power of toPower. -
Random function
A sequence of calls to rand() generates a stream of pseudo-random numbers. This function uses the java.util.Random class internally. -
Round function
Returns the closest integer value to the argument. -
Sign of Number function
- If a is a positive, this returns the sign of p1 as 1.0.
- If a is a negative, this returns the sign of p1 as -1.0.
- If a is neither a positive or a negative, this returns the sign of p1 as 0.0.
-
sin function
Returns the sine of p1 (p1 is in radians). This function wraps the java.lang.Math.sin() function. -
sinh function
Returns the hyperbolic sine of p1 (p1 is in radians). This function wraps the java.lang.Math.sinh() function. -
Square Root function
Returns the square-root of p1. This function wraps the java.lang.Math.sqrt() function. -
tan function
Returns the tan of p1 (p1 is in radians). This function wraps the java.lang.Math.tan() function. -
tanh function
Returns the hyperbolic tangent of p1 (p1 is in radians). This function wraps the java.lang.Math.tanh() function. -
To Degrees function
Converts p1 from radians to degrees. This function wraps the java.lang.Math.toDegrees() function. -
To Radians function
Converts p1 from degrees to radians. This function wraps the java.lang.Math.toRadians() function.
Extension
Download the JAR files of released versmapns from Maven Central:
https://mvnrepository.com/artifact/org.wso2.extension.siddhi.execution.math/siddhi-execution-math
Social Sites