You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
9 lines
646 B
9 lines
646 B
import { addArrayIntToNew, addOneToPositiveArrayInt, substractArrayIntToNew, trimArrayIntInplace, } from './internals/ArrayInt.js';
|
|
import { unsafeUniformArrayIntDistributionInternal } from './internals/UnsafeUniformArrayIntDistributionInternal.js';
|
|
export function unsafeUniformArrayIntDistribution(from, to, rng) {
|
|
var rangeSize = trimArrayIntInplace(addOneToPositiveArrayInt(substractArrayIntToNew(to, from)));
|
|
var emptyArrayIntData = rangeSize.data.slice(0);
|
|
var g = unsafeUniformArrayIntDistributionInternal(emptyArrayIntData, rangeSize.data, rng);
|
|
return trimArrayIntInplace(addArrayIntToNew({ sign: 1, data: g }, from));
|
|
}
|