sampleStep method

int sampleStep(
  1. Rng rng,
  2. int step
)

Uniform value on a grid of step within [lo, hi] (e.g. whole-dp steps of 100 for dp × 100 values).

Implementation

int sampleStep(Rng rng, int step) =>
    lo + step * rng.nextInt((hi - lo) ~/ step + 1);