Random has nextIntBetween, but no nextDoubleBetween.
@jonathanolson OK if I add this, of would you prefer a different implementation?
/**
* Randomly selects a double in the range [min,max).
* @param {number} min
* @param {number} max
* @returns {number}
*/
nextDoubleBetween: function ( min, max ) {
assert && assert( min < max, 'min must be < max' );
const value = min + this.nextDouble() * ( max - min );
assert && assert( value >= min && value < max, `value out of range: ${value}` );
return value;
}
Random
hasnextIntBetween
, but nonextDoubleBetween
.@jonathanolson OK if I add this, of would you prefer a different implementation?