Arithmetic
Perform computations on a set of given values.
add(X,Y)
Arithmetic function that adds the left and right arguments and returns the result. The input is implicitly converted to the highest type in the number hierarchy: Integer < Long < Float < Double.
- Function Input
- Left: number
- Right: number
- Function Output
- number
DSL example
Returns 2.
add(1, 1);
div(X,Y)
Arithmetic function that divides the left and right arguments and returns the result. It will return null for division by zero. Input is implicitly converted to the highest type in the number hierarchy: Integer < Long < Float < Double.
- Function Input
- Left: number
- Right: number
- Function Output
- number
DSL example
Returns 2.
div(3, 1.5F);
mul(X,Y)
Arithmetic function which multiplies the left and right arguments and returns the result. Input is implicitly converted to the highest type in the Number hierarchy: Integer < Long < Float < Double.
- Function Input
- Left: number
- Right: number
- Function Output
- number
DSL example
Returns 10.
mul(4L, 2.5D);
mod(X,Y)
Arithmetic function that finds the remainder after dividing the left and right arguments. It will return null for modulo by zero. Input is implicitly converted to the highest type in the number hierarchy: Integer < Long < Float < Double.
- Function Input
- Left: number
- Right: number
- Function Output
- number
DSL example
Returns 2.
mod(5L, 3);
subtract(X,Y)
Arithmetic function that subtracts the left and right arguments and returns the result. Input is implicitly converted to the highest type in the number hierarchy: Integer < Long < Float < Double.
- Function Input
- Left: number
- Right: number
- Function Output
- number
DSL example
Returns 11 as a float.
subtract(15F, 4L);
Aggregation | Boolean |
This documentation applies to the following versions of Splunk® Data Stream Processor: 1.0.1
Feedback submitted, thanks!