<?xml version="1.0" encoding="UTF-8"?><api:function-page xml:base="/apidoc/8.0/fn.abs.xml" generated="2015-10-07T16:36:00.016766-07:00" mode="javascript" xmlns:api="http://marklogic.com/rundmc/api"><api:function-name>fn.abs</api:function-name><api:suggest>fn.abs</api:suggest><api:suggest>fn</api:suggest><api:suggest>abs</api:suggest><api:function-link mode="xquery" fullname="fn:abs">/apidoc/8.0/fn:abs.xml</api:function-link><api:function mode="javascript" name="abs" type="builtin" lib="fn" category="NumericBuiltins" bucket="W3C-Standard Functions" hidden="false" prefix="fn" namespace="http://www.w3.org/2005/xpath-functions" fullname="fn.abs"><api:summary>
<p xmlns="http://www.w3.org/1999/xhtml">
Returns the absolute value of $arg. If $arg is negative returns -$arg
otherwise returns $arg. If type of $arg is one of the four numeric types
xs:float, xs:double, xs:decimal or xs:integer the type of the result is
the same as the type of $arg. If the type of $arg is a type derived from
one of the numeric types, the result is an instance of the base numeric
type. 
</p><p xmlns="http://www.w3.org/1999/xhtml">
For xs:float and xs:double arguments, if the argument is positive zero (+0)
or negative zero (-0), then positive zero (+0) is returned. If the argument
is positive or negative infinity, positive infinity is returned.
</p><p xmlns="http://www.w3.org/1999/xhtml">
For detailed type semantics, see Section 7.2.1 The fn:abs, fn:ceiling,
fn:floor, fn:round, and fn:round-half-to-even functions of [XQuery 1.0 and
XPath 2.0 Formal Semantics].
</p>
</api:summary><api:params><api:param name="arg" type="numeric?"><api:param-description>
A numeric value.
  </api:param-description><api:param-name>arg</api:param-name><api:param-type>numeric?</api:param-type></api:param></api:params><api:return>numeric?</api:return><api:example class="javascript"><pre xml:space="preserve" xmlns="http://www.w3.org/1999/xhtml">
fn.abs(10.5) 
=&gt; 10.5

fn.abs(-10.5)
=&gt; 10.5
</pre></api:example></api:function></api:function-page>