Skip to content

Commit

Permalink
Update src/lcg.js
Browse files Browse the repository at this point in the history
Co-authored-by: Mike Bostock <mbostock@gmail.com>
  • Loading branch information
Fil and mbostock committed Aug 26, 2020
1 parent d6e3b15 commit f3ac45b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lcg.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ const eps = 1/0x100000000;

export default function lcg(seed = Math.random()) {
if (!(0 <= seed && seed < 1)) throw new RangeError("invalid seed");
let state = seed/eps | 0;
let state = seed / eps | 0;
return () => (state = mul * state + inc | 0, eps * (state >>> 0));
}

0 comments on commit f3ac45b

Please sign in to comment.