< prev index next >
src/java.base/share/classes/java/util/Random.java
Print this page
8201634: Random seedUniquifier uses incorrect LCG
Summary: Correct typo in constant from L'Ecuyer
Reviewed-by: dl, psandoz
*** 108,118 ****
private static long seedUniquifier() {
// L'Ecuyer, "Tables of Linear Congruential Generators of
// Different Sizes and Good Lattice Structure", 1999
for (;;) {
long current = seedUniquifier.get();
! long next = current * 181783497276652981L;
if (seedUniquifier.compareAndSet(current, next))
return next;
}
}
--- 108,118 ----
private static long seedUniquifier() {
// L'Ecuyer, "Tables of Linear Congruential Generators of
// Different Sizes and Good Lattice Structure", 1999
for (;;) {
long current = seedUniquifier.get();
! long next = current * 1181783497276652981L;
if (seedUniquifier.compareAndSet(current, next))
return next;
}
}
< prev index next >