public class Rand {
private double seed;
public Rand() {
seed = System.currentTimeMillis();
}
public Rand(double seed) {
this.seed = seed;
}
private double random() {
seed = (seed * 9301 + 49297) % 233280;
return seed / 233280;
}
public int random(int m) {
return (int) (random() * m);
}
}
Linear congruential method requirements to obtain a random number
Guess you like
Origin www.cnblogs.com/continued258/p/12466787.html
Recommended
Ranking