Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/ddc_vim/deps.ts>fn.rand

Dark deno-powered completion framework for neovim/Vim8
Very Popular
Go to Latest
function fn.rand
import { fn } from "https://deno.land/x/ddc_vim@v3.8.2/deps.ts";
const { rand } = fn;

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. Returns -1 if {expr} is invalid.

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<number>