Numbers
Arithmetic helper functions returning numerical values as the result.
absolute
Returns the absolute value of the context argument.
Usage:
The argument is coerced into a number if possible. See number.
add
Returns the sum the context argument and all params.
Usage:
The arguments are coerced into a number if possible. See number.
ceiling
Returns the smallest integer that is not less than the argument.
Usage:
See the similar XPath 1.0 function.
divide
Returns the division of the first (context) argument and all params.
Usage:
The arguments are coerced into a number if possible. See number.
floor
Returns the largest integer that is not greater than the argument.
Usage:
See the similar XPath 1.0 function.
modulo
Returns the remainder of a division, after one number is divided by another.
This will internally return an integer or a float depending on the number type of the arguments.
Usage:
The arguments are coerced into a number if possible. See number.
multiply
Returns the multiplication of the first (context) argument and all params.
Usage:
The arguments are coerced into a number if possible. See number. Arguments that cannot be coerced into a number will be ignored.
negate
Returns the negation of the first (context) argument.
Usage:
The argument is coerced into a number if possible. See number. Arguments that cannot be coerced into a number will be ignored.
number
Converts the argument to a number.
nullvalues produce0- boolean true produces
1, boolean false produces0 - strings are parsed as Java double values.
- unparseable values produce
null.
See the similar XPath 1.0 function.
power
Raises a number to the power of the second argument.
round
Returns an integer closest in value to the argument.
See the similar XPath 1.0 function.
subtract
Returns the subtraction of the context argument and all params.
Usage:
The arguments are coerced into a number if possible. See number. Arguments that cannot be coerced into a number will be ignored.