The following routines return random integers of the given type uniformly distributed in [min, max]. These are member functions of Random.
| routine | type | min | max |
|---|---|---|---|
| Integer<IntType, b>() | IntType | 0 | 2b - 1 |
| Integer<b>() | unsigned | 0 | 2b - 1 |
| Integer(); | unsigned | 0 | std::numeric_limits<unsigned>::max() |
| Integer<IntType>() | IntType | std::numeric_limits<IntType>::min() | std::numeric_limits<IntType>::max() |
| Boolean() | bool | false | true |
| Integer<IntType>(IntType n) | IntType | 0 | n - 1 (if n == 0, std::numeric_limits<IntType>::max(); if n < 0, 0) |
| IntegerC<IntType>(IntType n) | IntType | 0 | n (if n < 0, 0) |
| IntegerC<IntType>(IntType m, IntType n) | IntType | m | n (if n < m, m) |
| operator()() | Random::result_type | 0 | 2w - 1 |
| operator()(result_type n) | Random::result_type | 0 | n - 1 (if n == 0, std::numeric_limits<result_type>::max()) |
1.5.6