diff options
author | Bram Moolenaar <Bram@vim.org> | 2019-11-28 22:13:14 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2019-11-28 22:13:14 +0100 |
commit | f8c1f9200c4b50969a8191a4fe0b0d09edb38979 (patch) | |
tree | 99c0903ad3e62049d83e6c8d118afd3c167f2d38 /runtime | |
parent | c7d2a57b3a076f6ecb16f93c0b09280c4b3b4175 (diff) |
patch 8.1.2356: rand() does not use the best algorithmv8.1.2356
Problem: rand() does not use the best algorithm.
Solution: use xoshiro128** instead of xorshift. (Kaito Udagawa,
closes #5279)
Diffstat (limited to 'runtime')
-rw-r--r-- | runtime/doc/eval.txt | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index b5460ffe3d..e6f7283f23 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -1,4 +1,4 @@ -*eval.txt* For Vim version 8.1. Last change: 2019 Nov 25 +*eval.txt* For Vim version 8.1. Last change: 2019 Nov 28 VIM REFERENCE MANUAL by Bram Moolenaar @@ -7641,7 +7641,7 @@ range({expr} [, {max} [, {stride}]]) *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 @@ -9150,11 +9150,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() |