randomized-algorithm/random

View on GitHub
src/api/randint.js

Summary

Maintainability
A
0 mins
Test Coverage
import _randint from '../kernel/_randint.js';

import random from './random.js';

/**
 * Returns an integer in interval [i, j[ (i included, j excluded)
 * according to a uniform distribution.
 *
 * @function
 * @param {number} i The inclusive left bound
 * @param {number} j The non-inclusive right bound
 * @return {number} An integer in the interval [i, j[ taken uniformly at
 * random.
 */
const randint = _randint(random);
export default randint;