The OpenD Programming Language

randIndex

  1. T randIndex(G gen, T _m)
    T
    randIndex
    (
    T
    G
    )
    (
    scope ref G gen
    ,
    T _m
    )
  2. T randIndex(G* gen, T m)
  3. T randIndex(T m)

Parameters

gen G

uniform random number generator

Return Value

Type: T

Uniformly distributed integer for interval [0 .. m$(RPAREN).

Examples

auto s = randIndex(100u);
auto n = randIndex!ulong(-100);
import mir.random;
import mir.random.engine.xorshift;
auto gen = Xorshift(1);
auto s = gen.randIndex!uint(100);
auto n = gen.randIndex!ulong(-100);

Meta