Re: mt_rand question
- From: Jerry Stuckle <jstucklex@xxxxxxxxxxxxx>
- Date: Wed, 19 Nov 2008 10:37:44 -0500
Mike wrote:
On Nov 19, 10:24 am, Mike <ampel...@xxxxxxxxx> wrote:Hello,
Why does this always give me 9 or 10 digits? never less?
$key = mt_rand(0,9999999999);
Thanks,
Mike
Maybe because > 95% of the numbers generated are between 100,000,000 and 2,147,483,647 (signed int max)? In a test, I do occasionally get 8 digit numbers (PHP 5.2.6).
Also,
I tried :
$key = mt_rand(1111111111,9999999999);
and still come up with 9 digits sometimes.
I tried this, and with over 100 iterations I never got a 9 digit number. But I also admit that's not a definitive test.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@xxxxxxxxxxxxx
==================
.
- References:
- mt_rand question
- From: Mike
- Re: mt_rand question
- From: Mike
- mt_rand question
- Prev by Date: Re: mt_rand question
- Next by Date: Re: Test pls ignore
- Previous by thread: Re: mt_rand question
- Index(es):
Relevant Pages
|