From d5b783615290da4e174fd457bd305cf2bc2cf94d Mon Sep 17 00:00:00 2001 From: Jake Date: Fri, 2 Oct 2020 20:17:15 -0400 Subject: [PATCH] Update docString for nextIntRangeInclusive to note un-usual distribution --- src/js/core/rng.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/js/core/rng.js b/src/js/core/rng.js index 9c5c1c43..02ce72d1 100644 --- a/src/js/core/rng.js +++ b/src/js/core/rng.js @@ -108,7 +108,12 @@ export class RandomNumberGenerator { assert(max > min, "rng: max <= min"); return Math.floor(this.next() * (max - min) + min); } + /** + * Generates a number between min and max, inclusive. + * note that it will only choose the numbers at the edge half as often + * as the rest of the set. For example with 0, 2 as inputs it will + * choose 1 twice as often as 0 or two. * @param {number} min * @param {number} max * @returns {number} Integer in range [min, max]