randomRangeClamp static method
Returns a pseudo-random double
number between parameters min
and
max
, clamping the returned value to clamp
.
Doesn't check for errors: Parameters can not be null
;
And min
> max
.
Implementation
@pragma("vm:prefer-inline")
static double randomRangeClamp(num min, num max, num clamp) {
return (randomRange(min.toDouble(), max.toDouble()) / clamp.toDouble())
.roundToDouble() *
clamp.toDouble();
}