The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
[PHP] rand() for large numbers
I need to generate a random number (with specified min and max) for small and large numbers. I'm using rand(*, *) right now and it doesn't seem to work with numbers in the billions. They go into the negative. What can I use instead?
|
#2
|
|||
|
|||
<a href="http://us3.php.net/manual/en/function.rand.php" target="_blank">http://us3.php.net/manual/en/function.rand.php</a>
|
#3
|
|||
|
|||
I have already checked the php.net rand function manual. The only thing mentioned that seems to be even remotely close to what I am achieving is the statement:
Quote:
So how do I generate a random number between two numbers in the tens of billions? |
#4
|
|||
|
|||
sorry but I can't help you any more I thought that would have helped
|
#5
|
|||
|
|||
It's ok. It's quite strange. The manual states that if you specify a min and max then you can generate a number larger then the RAND_MAX, but it doesn't work with trying to generate a number between 90% and 95% of a number in the tens of billions.
PHP Code:
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|