Changes

Jump to navigation Jump to search
1,920 bytes added ,  14:50, 19 July 2012
Created page with "This XQuery Module contains non-deterministic functions for returning random values. =Conventions= All functions in this module are assigned to the {{Code|ht..."
This [[Module Library|XQuery Module]] contains non-deterministic functions for returning random values.

=Conventions=

All functions in this module are assigned to the {{Code|http://basex.org/modules/random}} namespace, which is statically bound to the {{Code|random}} prefix.<br/>
All errors are assigned to the {{Code|http://basex.org/errors}} namespace, which is statically bound to the {{Code|bxerr}} prefix.

=Functions=

==random:random-double==
{|
|-
| width='90' | '''Signatures'''
|{{Func|random:random-double||xs:double()}}<br />
|-
| '''Summary'''
|Returns a double value between 0.0 (inclusive) and 1.0 (exclusive).<br />
|-
|
|
|}

==random:random-int==
{|
|-
| width='90' | '''Signatures'''
|{{Func|random:random-int|$max as xs:integer?|xs:integer()}}<br />
|-
| '''Summary'''
|Returns an integer value, either in the whole integer range or between 0 (inclusive) and the given maximum (exclusive)<br />
|-
|
|
|}

==random:seeded-random-double==
{|
|-
| width='90' | '''Signatures'''
|{{Func|random:seeded-random-int|$seed as xs:integer, $num as xs:integer|xs:items()*}}<br />
|-
| '''Summary'''
|Returns an sequence with {{Code|$num}} double values between 0.0 (inclusive) and 1.0 (exclusive). The random values are created using the initial seed given in {{Code|$seed}}.<br />
|-
|
|
|}

==random:seeded-random-int==
{|
|-
| width='90' | '''Signatures'''
|{{Func|random:seeded-random-int|$seed as xs:integer, $num as xs:integer, $max as xs:integer?|xs:items()*}}<br />
|-
| '''Summary'''
|Returns an sequence with {{Code|$num}} integer values, either in the whole integer range or between 0 (inclusive) and the given maximum (exclusive). The random values are created using the initial seed given in {{Code|$seed}}.<br />
|-
|
|
|}

=Changelog=

The module was introduced with Version X. It includes functionality which was previously located in the [[Math_Module|Math Module]].

[[Category:XQuery]]
administrator, editor
28

edits

Navigation menu