![]() |
[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?
|
<a href="http://us3.php.net/manual/en/function.rand.php" target="_blank">http://us3.php.net/manual/en/function.rand.php</a>
|
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? |
sorry but I can't help you any more I thought that would have helped
|
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:
|
All times are GMT. The time now is 03:37 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|