UNPKG

294 BJavaScriptView Raw
1/**
2 * Generate a random integer between a lower bound (inclusive) and an upper bound (exclusive)
3 *
4 * @param int a Lower bound (inclusive)
5 * @param int b Upper bound (exclusive)
6 */
7function randint(a, b) {
8 return a + Math.floor((b - a) * Math.random());
9}
10
11export default {
12 randint,
13};