Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class LCG {
- public LCG(long _a, long _c, long _m, long seed) {
- this.a = _a;
- this.c = _c;
- this.m = _m;
- }
- public long next() {
- long x =(this.a*seed+this.m)%this.c;
- seed(x);
- return x;
- }
- public void seed(long seed) {
- seed = this.seed;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement