Allahbaksh Asadullah
Allahbaksh Asadullah

Reputation: 686

Random Number Generation within range with different distribution in Java

I want to generate Random number in different range. For example range 10^14 in Java with different distribution like log, normal, binomial etc. Is there any particular library for the same. I found discussion on colt and math uncommon library. But is it safe enough to generate values as int and then multiply by the corresponding range suffix. What is best practice for the same.

Upvotes: 3

Views: 575

Answers (1)

pimaster
pimaster

Reputation: 1967

Apache Commons Math has a RandomDataImpl class that does nextBinomial, nextExponential and some other types (above my head unfortunately).

Hopefully that gets you everything you need. You might need to check some of the other classes in the library.

Upvotes: 2

Related Questions