diff options
author | Bram Moolenaar <Bram@vim.org> | 2019-11-26 21:44:46 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2019-11-26 21:44:46 +0100 |
commit | 0c0734d527a132edfb4089be48486586424b3f41 (patch) | |
tree | 6dc04964a23e8c85be6283a1642c06f2003bc7c2 /runtime/doc/eval.txt | |
parent | fc4ea2a72d36de1196a3ce17352e72f8fe90f4bb (diff) | |
download | vim-git-0c0734d527a132edfb4089be48486586424b3f41.tar.gz |
Update runtime files
Diffstat (limited to 'runtime/doc/eval.txt')
-rw-r--r-- | runtime/doc/eval.txt | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index 5936437af..b5460ffe3 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 24 +*eval.txt* For Vim version 8.1. Last change: 2019 Nov 25 VIM REFERENCE MANUAL by Bram Moolenaar @@ -7642,16 +7642,17 @@ range({expr} [, {max} [, {stride}]]) *range()* rand([{expr}]) *rand()* Return a pseudo-random Number generated with an xorshift - algorithm using seed {expr}. {expr} can be initialized by - |srand()| and will be updated by rand(). - If {expr} is omitted, an internal seed value is used and - updated. + 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 + rand(). If {expr} is omitted, an internal seed value is used + and updated. Examples: > :echo rand() :let seed = srand() :echo rand(seed) - :echo rand(seed) + :echo rand(seed) % 16 " random number 0 - 15 < *readdir()* readdir({directory} [, {expr}]) @@ -9149,7 +9150,8 @@ 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. + 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. |