Changes

Jump to navigation Jump to search
240 bytes added ,  13:23, 24 May 2018
no edit summary
=Conventions=
All functions and errors in this module are assigned to the {{Code|<code><nowiki>http://basex.org/modules/random}} </nowiki></code> 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:integer==
 
{{Mark|Updated with Version 8.0}}: raise error for invalid input.
{| width='100%'
|-
| '''Errors'''
|{{Error|BXRA0001bounds|#Errors}} the maximum value is out of bounds.
|}
==random:seeded-integer==
 
{{Mark|Updated with Version 8.0}}: raise error for invalid input.
{| width='100%'
|-
| '''Errors'''
|{{Error|BXRA0001bounds|#Errors}} the maximum value is out of bounds.<br/>{{Error|BXRA0002negative|#Errors}} the number of values to be returned is negative.
|}
| '''Summary'''
|Returns a sequence with {{Code|$num}} double values. The random values are Gaussian (i.e. normally) distributed with the mean 0.0. and the derivation 1.0.<br />
|}
 
==random:seeded-permutation==
 
{| width='100%'
|-
| width='120' | '''Signatures'''
|{{Func|random:seeded-permutation|$seed as xs:integer, $items as item()*|item()*}}
|-
| '''Summary'''
|Returns a random permutation of the specified {{Code|$items}}. The random order is created using the initial seed given in {{Code|$seed}}.<br />
|}
|Description
|-
|{{Code|BXRA0001bounds}}
|The specified maximum value is out of bounds.
|-
|{{Code|BXRA0002negative}}
|The specified number of values to be returned is negative.
|}
=Changelog=
 
;Version 9.0
 
* Updated: error codes updated; errors now use the module namespace
 
;Version 8.5
 
* Added: [[#random:seeded-permutation|random:seeded-permutation]]
;Version 8.0
The module was introduced with Version 7.5. It includes some functionality which was previously located in the [[Math_Module|Math Module]].
 
[[Category:XQuery]]
Bureaucrats, editor, reviewer, Administrators
13,550

edits

Navigation menu