home contribute faq download

FunctX XSLT Functions

fn:abs

The absolute value

Google
Webxsltfunctions.com

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 Type

NameType
$arg numeric?
return value numeric?

Examples

XPath ExampleResults
abs(3.5)
3.5
abs(-4)
4
abs(xs:float('-INF'))
INF

History

Published OnLast UpdatedContributor(s)
2006-06-272007-02-26W3C, XQuery 1.0 and XPath 2.0 Functions and Operators, http://www.w3.org/TR/xpath-functions/
Datypic XSLT Services

Recommended Reading:

XQuery