randomRangeIntClamp static method
Returns a pseudo-random int
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 int randomRangeIntClamp(num min, num max, num clamp) {
return (randomRangeInt(min.toInt(), max.toInt()) / clamp.toInt()).round() *
clamp.toInt();
}