<apidoc:module name="MathBuiltins" category="MathBuiltins" lib="math" xmlns:apidoc="http://marklogic.com/xdmp/apidoc"><apidoc:summary access="public">
The math built-in functions.
</apidoc:summary><apidoc:function name="acos" type="builtin" lib="math" category="MathBuiltins" hidden="false" bucket="MarkLogic Built-In Functions">
    <apidoc:summary>
  Returns the arc cosine of x, in radians,
  in the range from 0 to pi (inclusive).
</apidoc:summary>
    <apidoc:params>
      <apidoc:param name="x" type="xs:double" optional="false">
    The fraction to be evaluated. Must be in the range of -1 to +1 (inclusive).
  </apidoc:param>
    </apidoc:params>
    <apidoc:return>xs:double</apidoc:return>
    <apidoc:example><pre xml:space="preserve" xmlns="http://www.w3.org/1999/xhtml">
  math:acos(.5)

  =&gt; 1.0471975511966
</pre></apidoc:example>
  </apidoc:function><apidoc:function name="asin" type="builtin" lib="math" category="MathBuiltins" hidden="false" bucket="MarkLogic Built-In Functions">
    <apidoc:summary>
  Returns the arc sine of x, in radians,
  in the range from -pi/2 to +pi/2 (inclusive).
</apidoc:summary>
    <apidoc:params>
      <apidoc:param name="x" type="xs:double" optional="false">
    The fraction to be evaluated. Must be in the range of -1 to +1 (inclusive).
  </apidoc:param>
    </apidoc:params>
    <apidoc:return>xs:double</apidoc:return>
    <apidoc:example><pre xml:space="preserve" xmlns="http://www.w3.org/1999/xhtml">
  math:asin(.5)

  =&gt; 0.523598775598299
</pre></apidoc:example>
  </apidoc:function><apidoc:function name="atan" type="builtin" lib="math" category="MathBuiltins" hidden="false" bucket="MarkLogic Built-In Functions">
    <apidoc:summary>
  Returns the arc tangent of x, in radians.
  in the range from -pi/2 to +pi/2 (inclusive).
</apidoc:summary>
    <apidoc:params>
      <apidoc:param name="x" type="xs:double" optional="false">
  The floating point number to be evaluated.
  </apidoc:param>
    </apidoc:params>
    <apidoc:return>xs:double</apidoc:return>
    <apidoc:example><pre xml:space="preserve" xmlns="http://www.w3.org/1999/xhtml">
  math:atan(3.14159)

  =&gt; 1.26262701154934
</pre></apidoc:example>
  </apidoc:function><apidoc:function name="atan2" type="builtin" lib="math" category="MathBuiltins" hidden="false" bucket="MarkLogic Built-In Functions">
    <apidoc:summary>
  Returns the arc tangent of y/x, in radians, 
  in the range from -pi/2 to +pi/2 (inclusive),
  using the signs of y and x to determine the apropriate quadrant.
</apidoc:summary>
    <apidoc:params>
      <apidoc:param name="y" type="xs:double" optional="false">
  The floating point dividend.
  </apidoc:param>
      <apidoc:param name="x" type="xs:double" optional="false">
  The floating point divisor.
  </apidoc:param>
    </apidoc:params>
    <apidoc:return>xs:double</apidoc:return>
    <apidoc:example><pre xml:space="preserve" xmlns="http://www.w3.org/1999/xhtml">
  math:atan2(36.23, 5.234) 

  =&gt; 1.42732303452594 
  </pre></apidoc:example>
  </apidoc:function><apidoc:function name="cos" type="builtin" lib="math" category="MathBuiltins" hidden="false" bucket="MarkLogic Built-In Functions">
    <apidoc:summary>
  Returns the cosine of x,
  in the range from -1 to +1 (inclusive).
</apidoc:summary>
    <apidoc:params>
      <apidoc:param name="x" type="xs:double" optional="false">
    The floating point number to be evaluated. 
  </apidoc:param>
    </apidoc:params>
    <apidoc:return>xs:double</apidoc:return>
    <apidoc:example><pre xml:space="preserve" xmlns="http://www.w3.org/1999/xhtml">
  math:cos(11) 

  =&gt; 0.00442569798805079
</pre></apidoc:example>
  </apidoc:function><apidoc:function name="cosh" type="builtin" lib="math" category="MathBuiltins" hidden="false" bucket="MarkLogic Built-In Functions">
    <apidoc:summary>
  Returns the hyperbolic cosine of x.
</apidoc:summary>
    <apidoc:params>
      <apidoc:param name="x" type="xs:double" optional="false">
  The floating point number to be evaluated. 
  </apidoc:param>
    </apidoc:params>
    <apidoc:return>xs:double</apidoc:return>
    <apidoc:example><pre xml:space="preserve" xmlns="http://www.w3.org/1999/xhtml">
  math:cosh(11)

  =&gt; 29937.0708659498
  </pre></apidoc:example>
  </apidoc:function><apidoc:function name="sin" type="builtin" lib="math" category="MathBuiltins" hidden="false" bucket="MarkLogic Built-In Functions">
    <apidoc:summary>
  Returns the sine of x,
  in the range from -1 to +1 (inclusive).
</apidoc:summary>
    <apidoc:params>
      <apidoc:param name="x" type="xs:double" optional="false">
  The floating point number to be evaluated.
  </apidoc:param>
    </apidoc:params>
    <apidoc:return>xs:double</apidoc:return>
    <apidoc:example><pre xml:space="preserve" xmlns="http://www.w3.org/1999/xhtml">
  math:sin(1.95)

  =&gt; 0.928959715003869
</pre></apidoc:example>
  </apidoc:function><apidoc:function name="sinh" type="builtin" lib="math" category="MathBuiltins" hidden="false" bucket="MarkLogic Built-In Functions">
    <apidoc:summary>
  Returns the hyperbolic sine of x.
</apidoc:summary>
    <apidoc:params>
      <apidoc:param name="x" type="xs:double" optional="false">
    The floating point number to be evaluated.
  </apidoc:param>
    </apidoc:params>
    <apidoc:return>xs:double</apidoc:return>
    <apidoc:example><pre xml:space="preserve" xmlns="http://www.w3.org/1999/xhtml">
  math:sinh(1.95) 

  =&gt; 3.44320675450139
</pre></apidoc:example>
  </apidoc:function><apidoc:function name="tan" type="builtin" lib="math" category="MathBuiltins" hidden="false" bucket="MarkLogic Built-In Functions">
    <apidoc:summary>
  Returns the tangent of x.
</apidoc:summary>
    <apidoc:params>
      <apidoc:param name="x" type="xs:double" optional="false">
  The floating point number to be evaluated.
  </apidoc:param>
    </apidoc:params>
    <apidoc:return>xs:double</apidoc:return>
    <apidoc:example><pre xml:space="preserve" xmlns="http://www.w3.org/1999/xhtml">
  math:tan(19.5) 

  =&gt; 0.760905351982977
</pre></apidoc:example>
  </apidoc:function><apidoc:function name="tanh" type="builtin" lib="math" category="MathBuiltins" hidden="false" bucket="MarkLogic Built-In Functions">
    <apidoc:summary>
  Returns the hyperbolic tangent of x,
  in the range from -1 to +1 (inclusive).
</apidoc:summary>
    <apidoc:params>
      <apidoc:param name="x" type="xs:double" optional="false">
    The floating point number to be evaluated.
  </apidoc:param>
    </apidoc:params>
    <apidoc:return>xs:double</apidoc:return>
    <apidoc:example><pre xml:space="preserve" xmlns="http://www.w3.org/1999/xhtml">
  math:tanh(.95) 

  =&gt; 0.739783051274004
</pre></apidoc:example>
  </apidoc:function><apidoc:function name="exp" type="builtin" lib="math" category="MathBuiltins" hidden="false" bucket="MarkLogic Built-In Functions">
    <apidoc:summary>
  Returns e (approximately 2.71828182845905) to the xth power.
</apidoc:summary>
    <apidoc:params>
      <apidoc:param name="x" type="xs:double" optional="false">
    The exponent to be evaluated.
  </apidoc:param>
    </apidoc:params>
    <apidoc:return>xs:double</apidoc:return>
    <apidoc:example><pre xml:space="preserve" xmlns="http://www.w3.org/1999/xhtml">
  math:exp(.01) 

  =&gt; 1.01005016708417
</pre></apidoc:example>
  </apidoc:function><apidoc:function name="frexp" type="builtin" lib="math" category="MathBuiltins" hidden="false" bucket="MarkLogic Built-In Functions">
    <apidoc:summary>
  Returns x broken up into mantissa and exponent, where
  x = mantissa*2^exponent.
</apidoc:summary>
    <apidoc:params>
      <apidoc:param name="x" type="xs:double" optional="false">
    The exponent to be evaluated.
  </apidoc:param>
    </apidoc:params>
    <apidoc:return>(xs:double,xs:integer)</apidoc:return>
    <apidoc:example><pre xml:space="preserve" xmlns="http://www.w3.org/1999/xhtml">
  math:frexp(10) 

  =&gt; 0.625
     4
</pre></apidoc:example>
  </apidoc:function><apidoc:function name="ldexp" type="builtin" lib="math" category="MathBuiltins" hidden="false" bucket="MarkLogic Built-In Functions">
    <apidoc:summary>
  Returns x*2^i.
</apidoc:summary>
    <apidoc:params>
      <apidoc:param name="y" type="xs:double" optional="false">
  The floating-point number to be multiplied.
  </apidoc:param>
      <apidoc:param name="i" type="xs:integer" optional="false">
  The exponent integer.
  </apidoc:param>
    </apidoc:params>
    <apidoc:return>xs:double</apidoc:return>
    <apidoc:example><pre xml:space="preserve" xmlns="http://www.w3.org/1999/xhtml">
  math:ldexp(1.333, 10)

  =&gt; 1364.992
</pre></apidoc:example>
  </apidoc:function><apidoc:function name="log" type="builtin" lib="math" category="MathBuiltins" hidden="false" bucket="MarkLogic Built-In Functions">
    <apidoc:summary>
  Returns the base-e logarithm of x.
</apidoc:summary>
    <apidoc:params>
      <apidoc:param name="x" type="xs:double" optional="false">
    The floating point number to be evaluated.
  </apidoc:param>
    </apidoc:params>
    <apidoc:return>xs:double</apidoc:return>
    <apidoc:example><pre xml:space="preserve" xmlns="http://www.w3.org/1999/xhtml">
  math:log(1000))

  =&gt; 6.90775527898214
</pre></apidoc:example>
  </apidoc:function><apidoc:function name="log10" type="builtin" lib="math" category="MathBuiltins" hidden="false" bucket="MarkLogic Built-In Functions">
    <apidoc:summary>
  Returns the base-10 logarithm of x.
</apidoc:summary>
    <apidoc:params>
      <apidoc:param name="x" type="xs:double" optional="false">
    The floating point number to be evaluated.
  </apidoc:param>
    </apidoc:params>
    <apidoc:return>xs:double</apidoc:return>
    <apidoc:example><pre xml:space="preserve" xmlns="http://www.w3.org/1999/xhtml">
  math:log10(1000)) 

  =&gt; 3
</pre></apidoc:example>
  </apidoc:function><apidoc:function name="modf" type="builtin" lib="math" category="MathBuiltins" hidden="false" bucket="MarkLogic Built-In Functions">
    <apidoc:summary>
  Returns x broken up into fraction and integer.
  x = fraction+integer.
</apidoc:summary>
    <apidoc:params>
      <apidoc:param name="x" type="xs:double" optional="false">
    The floating point number to be evaluated.
  </apidoc:param>
    </apidoc:params>
    <apidoc:return>(xs:double,xs:double)</apidoc:return>
    <apidoc:example><pre xml:space="preserve" xmlns="http://www.w3.org/1999/xhtml">
  math:modf(1.333)

  =&gt; 0.333
     1
</pre></apidoc:example>
  </apidoc:function><apidoc:function name="pow" type="builtin" lib="math" category="MathBuiltins" hidden="false" bucket="MarkLogic Built-In Functions">
    <apidoc:summary>
  Returns x^y.
</apidoc:summary>
    <apidoc:params>
      <apidoc:param name="x" type="xs:double" optional="false">
  The floating-point base number.
  </apidoc:param>
      <apidoc:param name="y" type="xs:double" optional="false">
  The exponent to be applied to x.
  </apidoc:param>
    </apidoc:params>
    <apidoc:return>xs:double</apidoc:return>
    <apidoc:example><pre xml:space="preserve" xmlns="http://www.w3.org/1999/xhtml">
  math:pow(2, 10)

  =&gt; 1024
</pre></apidoc:example>
  </apidoc:function><apidoc:function name="sqrt" type="builtin" lib="math" category="MathBuiltins" hidden="false" bucket="MarkLogic Built-In Functions">
    <apidoc:summary>
  Returns the square root of x.
</apidoc:summary>
    <apidoc:params>
      <apidoc:param name="x" type="xs:double" optional="false">
    The floating point number to be evaluated.
  </apidoc:param>
    </apidoc:params>
    <apidoc:return>xs:double</apidoc:return>
    <apidoc:example><pre xml:space="preserve" xmlns="http://www.w3.org/1999/xhtml">
  math:sqrt(4) 

  =&gt; 2
</pre></apidoc:example>
  </apidoc:function><apidoc:function name="ceil" type="builtin" lib="math" category="MathBuiltins" hidden="false" bucket="MarkLogic Built-In Functions">
    <apidoc:summary>
  Returns the smallest integer greater than or equal to x.
</apidoc:summary>
    <apidoc:params>
      <apidoc:param name="x" type="xs:double" optional="false">
  The floating point number to be evaluated.
  </apidoc:param>
    </apidoc:params>
    <apidoc:return>xs:double</apidoc:return>
    <apidoc:example><pre xml:space="preserve" xmlns="http://www.w3.org/1999/xhtml">
  math:ceil(36.00001) 

  =&gt; 37
</pre></apidoc:example>
  </apidoc:function><apidoc:function name="fabs" type="builtin" lib="math" category="MathBuiltins" hidden="false" bucket="MarkLogic Built-In Functions">
    <apidoc:summary>
  Returns the absolute value of x.
</apidoc:summary>
    <apidoc:params>
      <apidoc:param name="x" type="xs:double" optional="false">
    The floating point number to be evaluated.
  </apidoc:param>
    </apidoc:params>
    <apidoc:return>xs:double</apidoc:return>
    <apidoc:example><pre xml:space="preserve" xmlns="http://www.w3.org/1999/xhtml">
  math:fabs(4.013)

  =&gt; 4.013
</pre></apidoc:example>
  </apidoc:function><apidoc:function name="floor" type="builtin" lib="math" category="MathBuiltins" hidden="false" bucket="MarkLogic Built-In Functions">
    <apidoc:summary>
  Returns the largest integer less than or equal to x.
</apidoc:summary>
    <apidoc:params>
      <apidoc:param name="x" type="xs:double" optional="false">
    The floating point number to be evaluated.
  </apidoc:param>
    </apidoc:params>
    <apidoc:return>xs:double</apidoc:return>
    <apidoc:example><pre xml:space="preserve" xmlns="http://www.w3.org/1999/xhtml">
  math:floor(4.013)

  =&gt; 4
</pre></apidoc:example>
  </apidoc:function><apidoc:function name="fmod" type="builtin" lib="math" category="MathBuiltins" hidden="false" bucket="MarkLogic Built-In Functions">
    <apidoc:summary>
  Returns the remainder of x/y.
</apidoc:summary>
    <apidoc:params>
      <apidoc:param name="x" type="xs:double" optional="false">
  The floating point dividend.
  </apidoc:param>
      <apidoc:param name="x" type="xs:double" optional="false">
  The floating point divisor.
  </apidoc:param>
    </apidoc:params>
    <apidoc:return>xs:double</apidoc:return>
    <apidoc:example><pre xml:space="preserve" xmlns="http://www.w3.org/1999/xhtml">
  math:fmod(10, 3)

  =&gt; 1
</pre></apidoc:example>
  </apidoc:function></apidoc:module>