Skip to content

YvonneW/siddhi-execution-math

 
 

Repository files navigation

siddhi-execution-math

The siddhi-execution-math is an extension to Siddhi, which provides useful mathematical functions that can make your siddhi queries more flexible.

For more information, see:

Latest API Docs

Latest API Docs is 4.0.17.

How to use

Using the extension with WSO2 Stream Processor

  • You can use this extension with the latest WSO2 Stream Processor offering, which supports an
    editor, debugger, and simulator.

  • By default, the latest version of this extension is shipped with WSO2 Stream Processor. If you wish to use an alternative version of this extension, replace the component jar that is available at the <STREAM_PROCESSOR_HOME>/lib directory.

Using the extension as a java library

  • This extension can be added as a maven dependency to your project along with other Siddhi dependencies.
     <dependency>
        <groupId>org.wso2.extension.siddhi.execution.math</groupId>
        <artifactId>siddhi-execution-math</artifactId>
        <version>x.x.x</version>
     </dependency>

Jenkins Build Status


Branch Build Status
master [Build Status](https://wso2
.org/jenkins/job/siddhi/job/siddhi-execution-math/)

Features

  • percentile (Aggregate Function)

    Returns the pth percentile value of the arg values.

  • abs (Function)

    Returns the absolute value of first parameter. 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)

    1. math:atan(p1) Returns the arc-tangent (inverse tangent) of p1. The return value is in radian scale. This function wraps the java.lang.Math.atan() function.
    2. Returns the arc-tangent (inverse tangent) of p1 and p2 coordinates. The return value is in radian scale. This function wraps the java.lang.Math.atan2() function.

  • bin (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 and java.lang.Long.toBinaryString methods.

  • cbrt (Function)

    Returns the cube-root of p1 (p1 is in radians). This function wraps the java.lang.Math.cbrt() function.

  • ceil (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 thejava.lang.Math.ceil() method.

  • conv (Function)

    Converts a from the fromBase base to the toBase base.

  • 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.

  • 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).

  • exp (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.

  • getExponent (Function)

    Returns the unbiased exponent used in the representation of p1. This function wraps the java.lang.Math.getExponent() function.

  • hex (Function)

    This function wraps the java.lang.Double.toHexString() function that returns a hexadecimal string representation of p1.

  • isInfinite (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.

  • isNan (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.

  • log (Function)

    Returns the logarithm (base=base) of number.

  • log10 (Function)

    Returns the base 10 logarithm of p1.

  • log2 (Function)

    Returns the base 2 logarithm of p1.

  • max (Function)

    Returns the greater value out of p1 and p2.

  • min (Function)

    Returns the smaller value out of p1 and p2.

  • oct (Function)

    Converts p1 to octal.

  • parseDouble (Function)

    Returns str as a double.

  • parseFloat (Function)

    Returns str as a float.

  • parseInt (Function)

    Returns str as a int.

  • parseLong (Function)

    Returns str as a long.

  • 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.

  • rand (Function)

    1. A sequence of calls to rand() generates a stream of pseudo-random numbers. This function uses the java.util.Random class internally.
    2. A sequence of calls to rand(seed) generates a stream of pseudo-random numbers. This function uses the java.util.Random class internally.

  • round (Function)

    Returns the closest integer/long (depending on the input) value to the argument.

  • signum (Function)

    If a is a positive, this returns the sign of p1 as 1.0. This function wraps the java.lang.Math.signum() function.

  • 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.

  • sqrt (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.

  • toDegrees (Function)

    Converts p1 from radians to degrees. This function wraps the java.lang.Math.toDegrees() function.

  • toRadians (Function)

    Converts p1 from degrees to radians. This function wraps the java.lang.Math.toRadians() function.

How to Contribute

Contact us

Support

  • We are committed to ensuring support for this extension in production. Our unique approach ensures that all support leverages our open development methodology and is provided by the very same engineers who build the technology.

  • For more details and to take advantage of this unique opportunity contact us via http://wso2.com/support/.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Java 100.0%