http://xqerl.org/modules/random
This module is statically bound to the prefix "random".
- Description
- Helper module for creating random values.
- Functions
random:double
- Signature
random:double() as xs:double
- Description
- Returns a random
xs:double
value greater than or equal to 0 and less than 1.
random:integer
- Signature
random:integer() as xs:integer
random:integer($max as xs:integer) as xs:integer- Description
- Returns a random
xs:integer
value greater than or equal to 0 and less than$max
.
The 0-ary version of this function is the same as calling the 1-ary version using 2^64.
random:seeded-double
- Signature
random:seeded-double($seed as xs:integer, $num as xs:integer) as xs:double*
- Description
- Returns a sequence of
$num
randomxs:double
values using$seed
as the seed.
random:seeded-integer
- Signature
random:seeded-integer($seed as xs:integer, $num as xs:integer) as xs:integer*
random:seeded-integer($seed as xs:integer, $num as xs:integer, $max as xs:integer) as xs:integer*- Description
- Returns a sequence of
$num
randomxs:integer
values using$seed
as the seed and$max
as the maximum value.
random:gaussian
- Signature
random:gaussian($num as xs:integer) as xs:double*
- Description
- Returns a sequence of
$num
normally distributedxs:double
values.
random:seeded-permutation
- Signature
random:seeded-permutation($seed as xs:integer, $items as item()*) as item()*
- Description
- Returns the sequence
$items
in a random order, using$seed
as the seed value.
random:uuid
- Signature
random:uuid() as xs:string
- Description
- Returns a random Universally Unique Identifer.