aboutsummaryrefslogtreecommitdiff
path: root/runtime
diff options
context:
space:
mode:
Diffstat (limited to 'runtime')
-rw-r--r--runtime/doc/builtin.txt12
1 files changed, 6 insertions, 6 deletions
diff --git a/runtime/doc/builtin.txt b/runtime/doc/builtin.txt
index 8d88c533f0..327b8dc4d9 100644
--- a/runtime/doc/builtin.txt
+++ b/runtime/doc/builtin.txt
@@ -5533,7 +5533,7 @@ range({expr} [, {max} [, {stride}]]) *range()*
GetExpr()->range()
<
rand([{expr}]) *rand()*
- Return a pseudo-random Number generated with an xorshift
+ Return a pseudo-random Number generated with an xoshiro128**
algorithm using seed {expr}. The returned number is 32 bits,
also on 64 bits systems, for consistency.
{expr} can be initialized by |srand()| and will be updated by
@@ -7200,11 +7200,11 @@ sqrt({expr}) *sqrt()*
srand([{expr}]) *srand()*
Initialize seed used by |rand()|:
- If {expr} is not given, seed values are initialized by
- time(NULL) a.k.a. epoch time. This only has second
- accuracy.
- - If {expr} is given, return seed values which x element is
- {expr}. This is useful for testing or when a predictable
- sequence is expected.
+ reading from /dev/urandom, if possible, or using time(NULL)
+ a.k.a. epoch time otherwise; this only has second accuracy.
+ - If {expr} is given it must be a Number. It is used to
+ initialize the seed values. This is useful for testing or
+ when a predictable sequence is intended.
Examples: >
:let seed = srand()