abs

The absolute value

Description

The fn:abs function accepts any numeric value and returns its absolute value. The result type depends the numeric type of the argument. If $arg is untyped, it is cast to xs:double.

Parameters

Description

arg:numeric()

Examples

XPath

Results

abs(3.5)

3.5

abs(-4)

4

abs(xs:float(‘-INF’))

INF