jRand icon indicating copy to clipboard operation
jRand copied to clipboard

Generate Mulitple of specific integer with NaturalGenerator

Open KEN-00 opened this issue 6 years ago • 0 comments

Hi . I would like to ask is there a way to generate a random natural number which is a multiple of a specific factor n?

For example:

int factor = 3;
NaturalGenerator naturalGenerator = JRand.natural();
naturalGenerator.min(0);
naturalGenerator.max(999);
//do something with factor
int randomMultiple = naturalGenerator.gen();

KEN-00 avatar Mar 25 '19 13:03 KEN-00