W3C

XQuery and XPath Functions and Operators Math Namespace Document

21 March 2017


1 Introduction

This document describes the namespace http://www.w3.org/2005/xpath-functions/math defined by the [XPath and XQuery Functions and Operators 3.1] specification. This namespace is conventionally identified by the namespace prefix math:. This prefix is not pre-declared in XQuery. For updated information, please refer to the latest version of the [XPath and XQuery Functions and Operators 3.1] specification.

This document describes the names that are defined in this namespace at the time of publication. The W3C reserves the right to define additional names in this namespace in the future. [XPath and XQuery Functions and Operators 3.1] is the only specification that may amend this namespace.

This document contains a directory of links to related resources, using RDDL (as defined in [Resource Directory Description Language (RDDL)]).

It is GRDDL-enabled (as defined in [Gleaning Resource Descriptions from Dialects of Languages (GRDDL)]), that is to say that a GRDDL-compliant processor can extract useful RDF (as defined in [Resource Description Framework (RDF): Concepts and Abstract Syntax]) representations of the information contained herein.

2 XQuery and XPath Math Functions

This section lists all of the functions defined by the [XPath and XQuery Functions and Operators 3.1] specification to be in the namespace reserved for certain mathematical functions.

Functions are uniquely identified by the combination of namespace URI, local name, and arity (number of arguments). For the purpose of this document, functions having a common namespace URI and local name can be considered to form a function family. A function family can be uniquely identified with a URI of the form: “http://www.w3.org/2005/xpath-functions/math#name” where name is the local name of a function, such as “sqrt”: http://www.w3.org/2005/xpath-functions/math#sqrt.

The normative definitions of these functions are in the [XPath and XQuery Functions and Operators 3.1] specification. For convenience, a very brief, non-normative summary of each function is provided. For details, follow the link on the “Summary:” introductory text below each function.

acos

acos(xs:double?) as xs:double?

Returns the arc cosine of the argument.

asin

asin(xs:double?) as xs:double?

Returns the arc sine of the argument.

atan

atan(xs:double?) as xs:double?

Returns the arc tangent of the argument.

atan2

atan2(xs:double, xs:double) as xs:double

Returns the angle in radians subtended at the origin by the point on a plane with coordinates (x, y) and the positive x-axis.

cos

cos(xs:double?) as xs:double?

Returns the cosine of the argument. The argument is an angle in radians.

exp

exp(xs:double?) as xs:double?

Returns the value of ex.

exp10

exp10(xs:double?) as xs:double?

Returns the value of 10x.

log

log(xs:double?) as xs:double?

Returns the natural logarithm of the argument.

log10

log10(xs:double?) as xs:double?

Returns the base-ten logarithm of the argument.

pi

pi() as xs:double

Returns an approximation to the mathematical constant π.

pow

pow(xs:double?, xs:numeric) as xs:double?

Returns the result of raising the first argument to the power of the second.

sin

sin(xs:double?) as xs:double?

Returns the sine of the argument. The argument is an angle in radians.

sqrt

sqrt(xs:double?) as xs:double?

Returns the non-negative square root of the argument.

tan

tan(xs:double?) as xs:double?

Returns the tangent of the argument. The argument is an angle in radians.

3 Normative References

These documents describe the names that are defined in this namespace at the time of publication. The W3C reserves the right to define additional names in this namespace in the future.

XPath and XQuery Functions and Operators 3.1

4 Non-Normative References

Resource Directory Description Language (RDDL)
Gleaning Resource Descriptions from Dialects of Languages (GRDDL)
Resource Description Framework (RDF): Concepts and Abstract Syntax