Changes

Jump to navigation Jump to search
684 bytes added ,  18:31, 15 June 2012
no edit summary
All functions in this module are assigned to the {{Code|http://www.w3.org/2005/xpath-functions/math}} namespace, which is statically bound to the {{Code|math}} prefix.<br/>
=W3 Functions=
==math:pi==
* {{Code|2*math:pi()}} returns {{Code|6.283185307179586e0}}.
* {{Code|60 * (math:pi() div 180)}} converts an angle of 60 degrees to radians.
|}
 
==math:e==
{|
|-
| width='90' | '''Signatures'''
|{{Func|math:e||xs:double}}
|-
| '''Summary'''
|Returns the {{Code|xs:double}} value of the mathematical constant <i>e</i> whose lexical representation is 2.718281828459045.
|-
| '''Examples'''
|
* {{Code|5*math:e()}} returns {{Code|13.591409142295225}}.
|}
|}
=Additional Functions= ==math:randome==
{|
|-
| width='90' | '''Signatures'''
|{{Func|math:randome||xs:double?}}
|-
| '''Summary'''
|Returns a random the {{Code|xs:double}} value between of the mathematical constant <i>e</i> whose lexical representation is 2.718281828459045.|-| '''Examples'''|* {{Code|0.05*math:e()}} and returns {{Code|113.0591409142295225}}.
|}
|
* {{Code|math:tanh(100)}} returns {{Code|1}}.
|}
 
==math:random==
{|
|-
| 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: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|$str}}.<br />
|-
| '''Examples'''
|
* {{Code|math:crc32("")}} returns {{Code|'00000000'}}.
* {{Code|math:crc32("BaseX")}} returns {{Code|'4C06FC7F'}}.
|}
 
==math:uuid==
{|
|-
| width='90' | '''Signatures'''
|{{Func|math:uuid||xs:string}}
|-
| '''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}}.
|}
Bureaucrats, editor, reviewer, Administrators
13,550

edits

Navigation menu