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 .
This description is © Copyright 2007, Priscilla Walmsley. It is excerpted from the book XQuery by Priscilla Walmsley, O'Reilly, 2007. For a complete explanation of this function, please refer to Appendix A of the book. Arguments and Return TypeName | Type |
$arg |
numeric? |
return value |
numeric? |
ExamplesXQuery Example | Results |
---|
abs(3.5) |
3.5 |
abs(-4) |
4 |
abs(xs:float('-INF')) |
INF |
History |
Recommended Reading: 
|