Constraints: a <= b.
X ~ U[a, b]
import mir.random.engine; auto gen = Random(unpredictableSeed); auto rv = uniformVar(-10, 10); // [-10, 10] static assert(isRandomVariable!(typeof(rv))); auto x = rv(gen); // random variable assert(rv.min == -10); assert(rv.max == 10);
import mir.random.engine; Random* gen = threadLocalPtr!Random; auto rv = UniformVariable!int(-10, 10); // [-10, 10] auto x = rv(gen); // random variable assert(rv.min == -10); assert(rv.max == 10);
$(WIKI_D Discrete_uniform).