private static final class randomnumbergeneratorholder {
static final random randomnumbergenerator = new random();
}
public static double random() {
return randomnumbergeneratorholder.randomnumbergenerator.nextdouble();
}
b = true
buf = [-55, 55, -7, -59, 86]
d = 0.6492428743107401
f = 0.8178623
i without bound = -1462220056
i with bound 100 = 66
gaussian = 0.3794413450456145
l = -5390332732391127434
b = true
buf = [47, -38, 53, 63, -72]
d = 0.46028809169559504
f = 0.015927613
i without bound = 169247282
i with bound 100 = 45
gaussian = -0.719106498075259
l = -7363680848376404625
b = true
buf = [47, -38, 53, 63, -72]
d = 0.46028809169559504
f = 0.015927613
i without bound = 169247282
i with bound 100 = 45
gaussian = -0.719106498075259
l = -7363680848376404625
private final atomiclong seed;
private static final long multiplier = 0x5deece66dl;
private static final long addend = 0xbl;
private static final long mask = (1l << 48) - 1;
private static final double double_unit = 0x1.0p-53; // 1.0 / (1l << 53)
private static final atomiclong seeduniquifier
= new atomiclong(8682522807148012l);
public random() {
this(seeduniquifier() ^ system.nanotime());
}
private static long seeduniquifier() {
for (;;) {
long current = seeduniquifier.get();
long next = current * 181783497276652981l;
if (seeduniquifier.compareandset(current, next))
return next;
}
}
public random(long seed) {
if (getclass() == random.class)
this.seed = new atomiclong(initialscramble(seed));
else {
this.seed = new atomiclong();
setseed(seed);
}
}
synchronized public void setseed(long seed) {
this.seed.set(initialscramble(seed));
havenextnextgaussian = false;
}