Changes

Jump to navigation Jump to search
70 bytes added ,  12:32, 2 July 2020
m
Text replacement - "[http://www.w3.org/TR/xpath-functions-30" to "[https://www.w3.org/TR/xpath-functions-31"
The math [[Module Library|XQuery Module]] defines functions to perform mathematical operations, such as {{Code|pi}}, {{Code|asin}} and {{Code|acos}}. Most functions are specified in the [httphttps://www.w3.org/TR/xpath-functions-3031/ Functions and Operators Specification] of the upcoming XQuery 3.0 Recommendation, and some additional ones have been added in this module.
=Conventions=
All functions in this module are assigned to the {{Code|<code><nowiki>http://www.w3.org/2005/xpath-functions/math}} </nowiki></code> namespace, which is statically bound to the {{Code|math}} prefix.<br/>
=W3 Functions=
==math:pi==
{|width='100%'
|-
| width='90120' | '''Signatures'''
|{{Func|math:pi||xs:double}}
|-
==math:sqrt==
{|width='100%'
|-
| width='90120' | '''Signatures'''
|{{Func|math:sqrt|$arg as xs:double?|xs:double?}}
|-
==math:sin==
{|width='100%'
|-
| width='90120' | '''Signatures'''
|{{Func|math:sin|$arg as xs:double?|xs:double?}}
|-
==math:cos==
{|width='100%'
|-
| width='90120' | '''Signatures'''
|{{Func|math:cos|$arg as xs:double?|xs:double?}}
|-
==math:tan==
{|width='100%'
|-
| width='90120' | '''Signatures'''|{{Func|math:tan|$ arg as xs:double?|xs:double?}}
|-
| '''Summary'''
==math:asin==
{|width='100%'
|-
| width='90120' | '''Signatures'''
|{{Func|math:asin|$arg as xs:double?|xs:double?}}
|-
==math:acos==
{|width='100%'
|-
| width='90120' | '''Signatures'''
|{{Func|math:acos|$arg as xs:double?|xs:double?}}
|-
==math:atan==
{|width='100%'
|-
| width='90120' | '''Signatures'''
|{{Func|math:atan|$arg as xs:double?|xs:double?}}
|-
==math:atan2==
{|width='100%'
|-
| width='90120' | '''Signatures'''
|{{Func|math:atan2|$arg1 as xs:double?, $arg2 as xs:double|xs:double?}}
|-
==math:pow==
{|width='100%'
|-
| width='90120' | '''Signatures'''
|{{Func|math:pow|$arg1 as xs:double?, $arg2 as xs:double|xs:double?}}
|-
==math:exp==
{|width='100%'
|-
| width='90120' | '''Signatures'''
|{{Func|math:exp|$arg as xs:double?|xs:double?}}
|-
==math:log==
{|width='100%'
|-
| width='90120' | '''Signatures'''
|{{Func|math:log|$arg as xs:double?|xs:double?}}
|-
==math:log10==
{|width='100%'
|-
| width='90120' | '''Signatures'''
|{{Func|math:log10|$arg as xs:double?|xs:double?}}
|-
==math:e==
{|width='100%'
|-
| width='90120' | '''Signatures'''
|{{Func|math:e||xs:double}}
|-
==math:sinh==
{|width='100%'
|-
| width='90120' | '''Signatures'''
|{{Func|math:sinh|$arg as xs:double?|xs:double?}}
|-
==math:cosh==
{|width='100%'
|-
| width='90120' | '''Signatures'''
|{{Func|math:cosh|$arg as xs:double?|xs:double?}}
|-
==math:tanh==
{|width='100%'
|-
| width='90120' | '''Signatures'''
|{{Func|math:tanh|$arg as xs:double?|xs:double?}}
|-
|}
==math:randomcrc32=={||-| width='90' | '''Signatures'''|{{Func|math:random||xs:double?}}|-| '''Summary'''|Returns a random {{Code|xs:double}} value between {{Code|0.0}} and {{Code|1.0}}.|}
==math:uuid=={|width='100%'
|-
| width='90120' | '''Signatures'''|{{Func|math:uuidcrc32|$string as xs:string?|xs:stringhexBinary?}}<br />
|-
| '''Summary'''
|Creates a random universally unique identifier (UUID), represented as 128-bit value.|-| '''Examples'''|* {{Code|math:uuid() ne util:uuid()}} will (most probably) return the boolean value {{Code|true}}.|} ==math:crc32=={||-| width='90' | '''Signatures'''|{{Func|math:crc32|$str as xs:string|xs:hexBinary}}<br />|-| '''Summary'''|Calculates the CRC32 check sum of the given string {{Code|$strstring}}.<br />If an empty sequence is supplied, the empty sequence is returned.
|-
| '''Examples'''
=Changelog=
 
; Version 9.1
* Updated: [[#math:crc32|math:crc32]] can be called with empty sequence.
 
; Version 7.5
* Moved: [[Random Module#random:integer|math:random]] and [[Random Module#random:uuid|math:uuid]] have been moved to [[Random Module]].
; Version 7.3
* Added: [[#math:crc32|math:crc32]] and [[Random Module#mathrandom:uuid|math:uuid]] have been adopted from the obsolete Utility Module. [[Category:XQuery]]
Bureaucrats, editor, reviewer, Administrators
13,550

edits

Navigation menu