1,920 bytes added
, 15:50, 19 July 2012
This [[Module LibraryXQuery Module]] contains nondeterministic functions for returning random values.
=Conventions=
All functions in this module are assigned to the {{Codehttp://basex.org/modules/random}} namespace, which is statically bound to the {{Coderandom}} prefix.<br/>
All errors are assigned to the {{Codehttp://basex.org/errors}} namespace, which is statically bound to the {{Codebxerr}} prefix.
=Functions=
==random:randomdouble==
{

 width='90'  '''Signatures'''
{{Funcrandom:randomdoublexs:double()}}<br />

 '''Summary'''
Returns a double value between 0.0 (inclusive) and 1.0 (exclusive).<br />



}
==random:randomint==
{

 width='90'  '''Signatures'''
{{Funcrandom:randomint$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:seededrandomdouble==
{

 width='90'  '''Signatures'''
{{Funcrandom:seededrandomint$seed as xs:integer, $num as xs:integerxs: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:seededrandomint==
{

 width='90'  '''Signatures'''
{{Funcrandom:seededrandomint$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_ModuleMath Module]].
[[Category:XQuery]]