diff options
author | Sean Dewar <seandewar@users.noreply.github.com> | 2022-01-09 23:26:03 +0000 |
---|---|---|
committer | Sean Dewar <seandewar@users.noreply.github.com> | 2022-02-05 14:00:59 +0000 |
commit | c97614d98fc7ab040851b7fe1bc4cb575ce8c627 (patch) | |
tree | 13f856aeae697cbcc6ec9da37efe74aee9f844b0 /runtime | |
parent | 061b06a8ae2e49e7921080ea4a1cc157e704bb28 (diff) | |
download | rneovim-c97614d98fc7ab040851b7fe1bc4cb575ce8c627.tar.gz rneovim-c97614d98fc7ab040851b7fe1bc4cb575ce8c627.tar.bz2 rneovim-c97614d98fc7ab040851b7fe1bc4cb575ce8c627.zip |
vim-patch:8.1.2356: rand() does not use the best algorithm
Problem: rand() does not use the best algorithm.
Solution: use xoshiro128** instead of xorshift. (Kaito Udagawa,
closes vim/vim#5279)
https://github.com/vim/vim/commit/f8c1f9200c4b50969a8191a4fe0b0d09edb38979
Diffstat (limited to 'runtime')
-rw-r--r-- | runtime/doc/builtin.txt | 12 |
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() |