comparison runtime/doc/eval.txt @ 18719:99586852c2db

Update runtime files Commit: https://github.com/vim/vim/commit/0c0734d527a132edfb4089be48486586424b3f41 Author: Bram Moolenaar <Bram@vim.org> Date: Tue Nov 26 21:44:46 2019 +0100 Update runtime files
author Bram Moolenaar <Bram@vim.org>
date Tue, 26 Nov 2019 21:45:05 +0100
parents 128662297ddf
children 2513e666aa82
comparison
equal deleted inserted replaced
18718:710efe6952f4 18719:99586852c2db
1 *eval.txt* For Vim version 8.1. Last change: 2019 Nov 24 1 *eval.txt* For Vim version 8.1. Last change: 2019 Nov 25
2 2
3 3
4 VIM REFERENCE MANUAL by Bram Moolenaar 4 VIM REFERENCE MANUAL by Bram Moolenaar
5 5
6 6
7640 GetExpr()->range() 7640 GetExpr()->range()
7641 < 7641 <
7642 7642
7643 rand([{expr}]) *rand()* 7643 rand([{expr}]) *rand()*
7644 Return a pseudo-random Number generated with an xorshift 7644 Return a pseudo-random Number generated with an xorshift
7645 algorithm using seed {expr}. {expr} can be initialized by 7645 algorithm using seed {expr}. The returned number is 32 bits,
7646 |srand()| and will be updated by rand(). 7646 also on 64 bits systems, for consistency.
7647 If {expr} is omitted, an internal seed value is used and 7647 {expr} can be initialized by |srand()| and will be updated by
7648 updated. 7648 rand(). If {expr} is omitted, an internal seed value is used
7649 and updated.
7649 7650
7650 Examples: > 7651 Examples: >
7651 :echo rand() 7652 :echo rand()
7652 :let seed = srand() 7653 :let seed = srand()
7653 :echo rand(seed) 7654 :echo rand(seed)
7654 :echo rand(seed) 7655 :echo rand(seed) % 16 " random number 0 - 15
7655 < 7656 <
7656 *readdir()* 7657 *readdir()*
7657 readdir({directory} [, {expr}]) 7658 readdir({directory} [, {expr}])
7658 Return a list with file and directory names in {directory}. 7659 Return a list with file and directory names in {directory}.
7659 You can also use |glob()| if you don't need to do complicated 7660 You can also use |glob()| if you don't need to do complicated
9147 9148
9148 9149
9149 srand([{expr}]) *srand()* 9150 srand([{expr}]) *srand()*
9150 Initialize seed used by |rand()|: 9151 Initialize seed used by |rand()|:
9151 - If {expr} is not given, seed values are initialized by 9152 - If {expr} is not given, seed values are initialized by
9152 time(NULL) a.k.a. epoch time. 9153 time(NULL) a.k.a. epoch time. This only has second
9154 accuracy.
9153 - If {expr} is given, return seed values which x element is 9155 - If {expr} is given, return seed values which x element is
9154 {expr}. This is useful for testing or when a predictable 9156 {expr}. This is useful for testing or when a predictable
9155 sequence is expected. 9157 sequence is expected.
9156 9158
9157 Examples: > 9159 Examples: >