The OpenD Programming Language

randIndex

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

Parameters

gen G*

uniform random number generator

m T

positive module

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