Package org.metricshub.jawk.jrt
Class BSDRandom
java.lang.Object
org.metricshub.jawk.jrt.BSDRandom
Simple pseudo-random number generator compatible with the C library
random() function.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondoubleReturn the next pseudo-random number in the range[0.0,1.0).final voidsetSeed(int seed) Seed the generator.
-
Constructor Details
-
BSDRandom
public BSDRandom(int seed) Create a new generator with the specified seed.
-
-
Method Details
-
setSeed
public final void setSeed(int seed) Seed the generator. A seed of0is transformed to1as in the original implementation. -
nextDouble
public double nextDouble()Return the next pseudo-random number in the range[0.0,1.0).
-