XQuery Function Documentation

Search and Browse

http://exist-db.org/xquery/math

java:org.exist.xquery.modules.math.MathModule

A module containing functions for common mathematical operations.

abs

abs($x as xs:double) as xs:double

Calculates the absolute value (distance from zero) of a value or expression

Parameters:
$x The value to return the absolute value of
Returns:
xs:double : the absolute value (distance from zero) of a value or expression

acos

acos($x as xs:double) as xs:double

Returns the arc cosine of an angle, in the range of 0.0 through pi.

Parameters:
$x The input number
Returns:
xs:double : the result
Deprecated:
Moved to the module: http://www.w3.org/2005/xpath-functions/math, you should now use 'math:acos' instead! This function could be removed in the next major release version.

asin

asin($x as xs:double) as xs:double

Returns the arc sine of an angle, in the range of -pi/2 through pi/2.

Parameters:
$x The input number
Returns:
xs:double : result
Deprecated:
Moved to the module: http://www.w3.org/2005/xpath-functions/math, you should now use 'math:asin' instead! This function could be removed in the next major release version.

atan

atan($x as xs:double) as xs:double

Returns the arc tangent of an angle, in the range of -pi/2 through pi/2.

Parameters:
$x The input number
Returns:
xs:double : the result
Deprecated:
Moved to the module: http://www.w3.org/2005/xpath-functions/math, you should now use 'math:atan' instead! This function could be removed in the next major release version.

atan2

atan2($y as xs:double, $x as xs:double) as xs:double

Returns the angle theta from the conversion of rectangular coordinates (x, y) to polar coordinates (r, theta).

Parameters:
$y The y coordinate
$x The x coordinate
Returns:
xs:double : the theta component of the point (r, theta) in polar coordinates that corresponds to the point (x, y) in Cartesian coordinates.
Deprecated:
Moved to the module: http://www.w3.org/2005/xpath-functions/math, you should now use 'math:atan2' instead! This function could be removed in the next major release version.

ceil

ceil($x as xs:double) as xs:double

Returns the smallest (closest to negative infinity) value that is not less than the argument and is equal to a mathematical integer.

Parameters:
$x The input number
Returns:
xs:double : result

cos

cos($x as xs:double) as xs:double

Returns the trigonometric cosine of an angle.

Parameters:
$x The input number
Returns:
xs:double : the cosine
Deprecated:
Moved to the module: http://www.w3.org/2005/xpath-functions/math, you should now use 'math:cos' instead! This function could be removed in the next major release version.

degrees

degrees($radians as xs:double) as xs:double

Converts angle in radians to degrees.

Parameters:
$radians The radians
Returns:
xs:double : the degrees

e

e() as xs:double

Returns base of the natural logarithms, e.

Returns:
xs:double : the value of e

exp

exp($x as xs:double) as xs:double

Calculates e (the Euler Constant) raised to the power of a value or expression

Parameters:
$x The input number
Returns:
xs:double : e (the Euler Constant) raised to the power of a value or expression
Deprecated:
Moved to the module: http://www.w3.org/2005/xpath-functions/math, you should now use 'math:exp' instead! This function could be removed in the next major release version.

floor

floor($x as xs:double) as xs:double

Returns the largest (closest to positive infinity) value that is not greater than the argument and is equal to a mathematical integer.

Parameters:
$x The input number
Returns:
xs:double : the floor value

log

log($x as xs:double) as xs:double

Returns the natural logarithm (base e) of a number.

Parameters:
$x The input number
Returns:
xs:double : the log
Deprecated:
Moved to the module: http://www.w3.org/2005/xpath-functions/math, you should now use 'math:log' instead! This function could be removed in the next major release version.

pi

pi() as xs:double

Returns the value of pi.

Returns:
xs:double : the value of pi
Deprecated:
Moved to the module: http://www.w3.org/2005/xpath-functions/math, you should now use 'math:pi' instead! This function could be removed in the next major release version.

power

power($value as xs:double, $power as xs:double) as xs:double

Returns the value of $value raised to the power of $power.

Parameters:
$value The value
$power The power to raise the value to
Returns:
xs:double : the result
Deprecated:
Moved to the module: http://www.w3.org/2005/xpath-functions/math, you should now use 'math:pow' instead! This function could be removed in the next major release version.

radians

radians($degrees as xs:double) as xs:double

Converts angle in degrees to radians.

Parameters:
$degrees The degrees
Returns:
xs:double : the radians

random

random() as xs:double

Returns a value greater than or equal to 0.0 and less than 1.0.

Returns:
xs:double : a random value

round

round($x as xs:double) as xs:double

Returns the double value that is closest to a integer.

Parameters:
$x The input number
Returns:
xs:double : the rounded value

sin

sin($x as xs:double) as xs:double

Returns the trigonometric sine of an angle.

Parameters:
$x The input number
Returns:
xs:double : the sine
Deprecated:
Moved to the module: http://www.w3.org/2005/xpath-functions/math, you should now use 'math:sin' instead! This function could be removed in the next major release version.

sqrt

sqrt($x as xs:double) as xs:double

Returns the correctly rounded positive square root of a number.

Parameters:
$x The input number
Returns:
xs:double : the square root of $x
Deprecated:
Moved to the module: http://www.w3.org/2005/xpath-functions/math, you should now use 'math:sqrt' instead! This function could be removed in the next major release version.

tan

tan($radians as xs:double) as xs:double

Returns the tangent of the number passed as an argument in radians.

Parameters:
$radians The radians
Returns:
xs:double : the tangent
Deprecated:
Moved to the module: http://www.w3.org/2005/xpath-functions/math, you should now use 'math:tan' instead! This function could be removed in the next major release version.