WSO2 Complex Event Processor is succeeded by WSO2 Stream Processor. To view the latest documentation for WSO2 SP, see WSO2 Stream Processor Documentation.

Versions Compared


  • This line was added.
  • This line was removed.
  • Formatting was changed.

Math extension provides basic mathematical functions such as calculating absolute value, sin, cos, tan, base conversion, parsing, etc. Usage of math extension in a query is as follows.

Code Block
FROM inputStream
SELECT id, math:abs(3) as absoluteValue
INSERT INTO outputStream;

Following  Following are the functions of the Math extension. 

Table of Contents


Absolute Value Function

Syntax<double> math:abs(<float|double> p1)
Extension TypeFunction
DescriptionReturns the absolute value of p1. This function wraps the java.lang.Math.abs() function.

Both the following queries return 3 since the absolute value of both 3 and -3 is 3.

  • abs(3)
  • abs(-3)