A RESTful browser for eXist Function Modules


http://exist-db.org/xquery/math
A module containing functions for common mathematical operations.

math:abs($x as xs:double) xs:double
Calculates the absolute value (distance from zero) of a value or expression
$xThe value to return the absolute value of

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

math:acos($x as xs:double) xs:double
Returns the arc cosine of an angle, in the range of 0.0 through pi.
$xThe input number

Returns the result

math:asin($x as xs:double) xs:double
Returns the arc sine of an angle, in the range of -pi/2 through pi/2.
$xThe input number

Returns result

math:atan($x as xs:double) xs:double
Returns the arc tangent of an angle, in the range of -pi/2 through pi/2.
$xThe input number

Returns the result

math:atan2($y as xs:double, $x as xs:double) xs:double
Returns the angle theta from the conversion of rectangular coordinates (x, y) to polar coordinates (r, theta).
$yThe y coordinate
$xThe x coordinate

Returns the theta component of the point (r, theta) in polar coordinates that corresponds to the point (x, y) in Cartesian coordinates.

math:ceil($x as xs:double) xs:double
Returns the smallest (closest to negative infinity) value that is not less than the argument and is equal to a mathematical integer.
$xThe input number

Returns result

math:cos($x as xs:double) xs:double
Returns the trigonometric cosine of an angle.
$xThe input number

Returns the cosine

math:degrees($radians as xs:double) xs:double
Converts angle in radians to degrees.
$radiansThe radians

Returns the degrees

math:e() xs:double
Returns base of the natural logarithms, e.

Returns the value of e

math:exp($x as xs:double) xs:double
Calculates e (the Euler Constant) raised to the power of a value or expression
$xThe input number

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

math:floor($x as xs:double) xs:double
Returns the largest (closest to positive infinity) value that is not greater than the argument and is equal to a mathematical integer.
$xThe input number

Returns the floor value

math:log($x as xs:double) xs:double
Returns the natural logarithm (base e) of a number.
$xThe input number

Returns the log

math:pi() xs:double
Returns the value of pi.

Returns the value of pi

math:power($value as xs:double, $power as xs:double) xs:double
Returns the value of $value raised to the power of $power.
$valueThe value
$powerThe power to raise the value to

Returns the result

math:radians($degrees as xs:double) xs:double
Converts angle in degrees to radians.
$degreesThe degrees

Returns the radians

math:random() xs:double
Returns a value greater than or equal to 0.0 and less than 1.0.

Returns a random value

math:round($x as xs:double) xs:double
Returns the double value that is closest to a integer.
$xThe input number

Returns the rounded value

math:sin($x as xs:double) xs:double
Returns the trigonometric sine of an angle.
$xThe input number

Returns the sine

math:sqrt($x as xs:double) xs:double
Returns the correctly rounded positive square root of a number.
$xThe input number

Returns the square root of $x

math:tan($radians as xs:double) xs:double
Returns the tangent of the number passed as an argument in radians.
$radiansThe radians

Returns the tangent
Return to list of all modules