There's no new solution in this post. I just felt the thread could use some clarity. For starters, there are two problems at play here.
log2(10**12) is slightly less than 40. That means your random number generator must be capable of producing 40 bit random numbers. According to BrowserUK, Active State's generator produces 15 bit numbers.
It also means you need to be capable of receiving 40bit numbers from the random number generator. perl's floats have sufficient precision to hold a 40 bit number, so you'll have to find a random number generator that returns 40+ bit floats. Alternatively, you can increase the precison of your integers (by using Math::BigInt, for example) and using a random number generator capable of returning numbers in that format (like Zaxo's solution, for example).
In reply to Re: Rand Wackiness!
by ikegami
in thread Rand Wackiness!
by SleepyJay
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |