Skip to content

Generate Mulitple of specific integer with NaturalGenerator #46

@KEN-00

Description

@KEN-00

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();

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions