Interval between numbers
Start. Defaults to 0
Optional
end: numberEnd (if undefined, range never ends)
Range loops from start indefinately. Default false
Optional
rounding: numberA rounding that matches the interval avoids floating-point math hikinks. Eg if the interval is 0.1, use a rounding of 10
let loopForever = numericRange(0.1); // By default starts at 0 and counts upwards forever
for (v of loopForever) {
console.log(v);
}
let percent = numericRange(0.1, 0, 1);
let percentResult = percent.next().value;
Note that computations are internally rounded to avoid floating point math issues. So if the interval
is very small (eg thousandths), specify a higher rounding
number.
Generates a range of numbers, with a given interval.