Commons RNG provides implementations of pseudo-random numbers generators that are
faster; of higher quality; and/or of a longer period than
java.util.Random and java.util.SplittableRandom.
The "client API" module contains the code that defines the API for client code.
Example:
import org.apache.commons.rng.UniformRandomProvider;
public class Dice {
public int roll(UniformRandomProvider rng) {
// Sample in [1, 6]
return rng.nextInt(1, 7);
}
}
Browse the Javadoc to see the complete API.
Copyright © 2016-2024 The Apache Software Foundation. All Rights Reserved.