Skip to main content
Deno 2 is finally here ๐ŸŽ‰๏ธ
Learn more
Module

x/denops_std/function/vim/mod.ts>rand

๐Ÿ“š Standard module for denops.vim
Go to Latest
function rand
import { rand } from "https://deno.land/x/denops_std@v3.6.0/function/vim/mod.ts";

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 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) % 16 " random number 0 - 15

Parameters

denops: Denops
optional
expr: unknown

Returns

Promise<unknown>