> I need a random number generator that is better than rand()
I know of two main applications for needing randomness.
- statistics
- cryptography
Which one do you want a random number generator for (or do you have some other purpose in mind)?
Not all generators are ideally suited to any purpose.
> The maxnum is not large enough.
So take a few bits from successive calls to rand() until you have enough bits.
Simple example:
[tt]int aBiggerRand = rand() * 100 + rand();[/tt]
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.