odin-js-fundamentals-part-4/node_modules/pure-rand/lib/esm/distribution/UniformIntDistribution.js

13 lines
452 B
JavaScript
Raw Normal View History

2024-01-05 19:30:21 +00:00
import { unsafeUniformIntDistribution } from './UnsafeUniformIntDistribution.js';
function uniformIntDistribution(from, to, rng) {
if (rng != null) {
var nextRng = rng.clone();
return [unsafeUniformIntDistribution(from, to, nextRng), nextRng];
}
return function (rng) {
var nextRng = rng.clone();
return [unsafeUniformIntDistribution(from, to, nextRng), nextRng];
};
}
export { uniformIntDistribution };