List of utility methods to do Random Double
double | random(final double min, final double max) random final double random = Math.random(); return random * (max - min) + min; |
int | randomBetween(double arg1, double arg2) random Between int i1 = (int) Math.ceil(arg1 < arg2 ? arg1 : arg2); int i2 = (int) Math.ceil(arg2 > arg1 ? arg2 : arg1); return i1 + (int) ((i2 - i1) * Math.random() + 0.5); |
double | randomBoth(double range) random Both return (Math.random() * range * 2.0) - range;
|
boolean | randomChance(double chance) generates a random output based on a chance return Math.random() < chance;
|
String | randomColor(double d) random Color return "rgba(" + randomColorFactor() + "," + randomColorFactor() + "," + randomColorFactor() + "," + d + ")"; |
double | randomDouble() Returns a random double in the range 0.0 (inclusive) and 1.0 (exclusive). return _randomSeq.nextDouble();
|
double | randomDouble() random double value between 0 and 1 return r.nextDouble();
|
double | randomDouble() random Double return random.nextDouble();
|
double | randomDouble() random Double return random.nextDouble();
|
double | randomDouble() Generates random double value in range of 1.00 to 100.00 rounded to 2 decimal digits return Math.round(Math.random() * 10000d) / 100d;
|