# fn:abs - XPath XQuery Reference

Returns the absolute value of $arg.deterministiccontext-independentfocus-independentGeneral rules: see .If $arg is negative the function returns -$arg, otherwise it
            returns $arg.For the four types xs:float,
               xs:double, xs:decimal and xs:integer, it is
            guaranteed that if the type of $arg is an instance of type T then
            the result will also be an instance of T. The result may
            also be an instance of a type derived from one of these four by restriction. For example, if
            $arg is an instance of xs:positiveInteger then the value of
            $argmay be returned unchanged.For xs:float and xs:double arguments, if the argument is
            positive zero or negative zero, then positive zero is returned. If the argument is
            positive or negative infinity, positive infinity is returned.fn:abs(10.5)10.5fn:abs(-10.5)10.5