arne2
12-21-2006, 11:11 AM
Hi
How come my mt_rand returns negative numbers while it shouldn't?
<?
//SMALL MT_RAND COMPATIBILITY TEST
$echoout=mt_rand(1000000000000,22000000000000);
echo"$echoout";
?>
Sometimes it gives me a positive number (i once had : 75587147 ) but mostly i get things like -216672647
I think it's because the numbers are so big. Is there a function that creates a random number between two bcmathic numbers. I already use bcmathic functions like bcmul and bcmod etc on my page because of the high numbers. Is there a function that can create a random number between to big numbers?
THank you very much
P.S. It shouldn't be a very 'difficult' function, as simple as possible as i will have to execute it a lot of times, so it shouldn't take too long to calculate!
THANK YOU VERY MUCH FOR YOUR HELP!
How come my mt_rand returns negative numbers while it shouldn't?
<?
//SMALL MT_RAND COMPATIBILITY TEST
$echoout=mt_rand(1000000000000,22000000000000);
echo"$echoout";
?>
Sometimes it gives me a positive number (i once had : 75587147 ) but mostly i get things like -216672647
I think it's because the numbers are so big. Is there a function that creates a random number between two bcmathic numbers. I already use bcmathic functions like bcmul and bcmod etc on my page because of the high numbers. Is there a function that can create a random number between to big numbers?
THank you very much
P.S. It shouldn't be a very 'difficult' function, as simple as possible as i will have to execute it a lot of times, so it shouldn't take too long to calculate!
THANK YOU VERY MUCH FOR YOUR HELP!