Math Functions
This module defines functions to perform mathematical operations, such as pi
, asin
and acos
. Most functions are described in detail in the XQuery Functions and Operators Specification, and some functions have been added.
Removed: math:crc-32
is not part of the new XQuery 4 standard function fn:hash.
All functions in this module are assigned to the http://www.w3.org/2005/xpath-functions/math
namespace, which is statically bound to the math
prefix.
Signature | math:pi() as xs:double |
---|
Summary | Returns the value of the mathematical constant π. |
---|
Examples | math:pi() Result: 3.141592653589793e0
60 * (math:pi() div 180) Converts an angle of 60 degrees to radians. |
---|
Signature | math:e() as xs:double |
---|
Summary | Returns the xs:double value of the mathematical constant e. |
---|
Examples | math:e() Result: 2.718281828459045e0 |
---|
Signature | math:sqrt(
$value as xs:double?
) as xs:double? |
---|
Summary | Returns the square root of $value . |
---|
Signature | math:pow(
$x as xs:double?,
$y as xs:double
) as xs:double? |
---|
Summary | Returns $x raised to the power of $y . |
---|
Examples | math:pow(2, 3) Result: 8 |
---|
Signature | math:exp(
$value as xs:double?
) as xs:double? |
---|
Summary | Returns e raised to the power of $value . |
---|
Examples | math:exp(1) Returns e. |
---|
Signature | math:log(
$value as xs:double?
) as xs:double? |
---|
Summary | Returns the natural logarithm (base e) of $value . |
---|
Examples | math:log(math:e()) Result: 1 |
---|
Signature | math:log10(
$value as xs:double?
) as xs:double? |
---|
Summary | Returns the base 10 logarithm of $value . |
---|
Examples | math:log(100) Result: 4.605170185988092e0 |
---|
Signature | math:sin(
$radians as xs:double?
) as xs:double? |
---|
Summary | Returns the sine of $radians , expressed as an angle in radians. |
---|
Signature | math:cos(
$radians as xs:double?
) as xs:double? |
---|
Summary | Returns the cosine of $radians , expressed as an angle in radians. |
---|
Signature | math:tan(
$radians as xs:double?
) as xs:double? |
---|
Summary | Returns the tangent of $radians , expressed as an angle in radians. |
---|
Signature | math:asin(
$value as xs:double?
) as xs:double? |
---|
Summary | Returns the arc sine of $value , expressed as an angle in radians in the range –π/2 to +π/2. |
---|
Signature | math:acos(
$value as xs:double?
) as xs:double? |
---|
Summary | Returns the arc cosine of $value , expressed as an angle in radians in the range 0 to +π. |
---|
Signature | math:atan(
$value as xs:double?
) as xs:double? |
---|
Summary | Returns the arc tangent of $value , expressed as an angle in radians in the range –π/2 to +π/2. |
---|
Signature | math:atan2(
$x as xs:double?,
$y as xs:double
) as xs:double? |
---|
Summary | Returns the arc tangent of $x divided by $y , expressed as an angle in radians in the range –π to +π. |
---|
Signature | math:sinh(
$value as xs:double?
) as xs:double? |
---|
Summary | Returns the hyperbolic sine of $value |
---|
Examples | math:sinh(0) Result: 0 |
---|
Signature | math:cosh(
$value as xs:double?
) as xs:double? |
---|
Summary | Returns the hyperbolic cosine of $value . |
---|
Examples | math:cosh(0) Result: 1 |
---|
Signature | math:tanh(
$value as xs:double?
) as xs:double? |
---|
Summary | Returns the hyperbolic tangent of $value . |
---|
Examples | math:tanh(100) Result: 1 |
---|
Version 11.0Version 9.1- Updated:
math:crc32
can be called with empty sequence.
Version 7.5Version 7.3- Added:
math:crc32
and math:uuid
have been adopted from the obsolete Utility Module.
⚡Generated with XQuery