Re: mt_rand question



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
==================
.



Relevant Pages

  • RE: Count number of digits (Numbers)
    ... Fantastic - Thank you very much Mike ... equal to six digits if that makes any sense. ... Each cell is picking up ...
    (microsoft.public.excel.misc)
  • RE: How to Combine two cells (numbers) but not add
    ... I forgot to add this works for both so use this instead of the first formula ... "Mike H" wrote: ... "evoxfan" wrote: ... So how can I make B1 have three digits in this case? ...
    (microsoft.public.excel.misc)
  • RE: change text to real dates
    ... Yes Mike; an excellent source ... "Jacob Skaria" wrote: ... i have extracted text within texts in a column of data thru left & right ... Days and the last 2 digits are Years. ...
    (microsoft.public.excel.misc)
  • RE: change text to real dates
    ... "Mike H" wrote: ... "driller" wrote: ... i have extracted text within texts in a column of data thru left & right ... Days and the last 2 digits are Years. ...
    (microsoft.public.excel.misc)
  • Re: Overflow error
    ... On Thu, 13 Oct 2005 19:35:16 GMT, Mike wrote: ... >I have the SQL table column PRICE set for decimal. ... Leaving no digits to the left. ...
    (comp.databases.ms-sqlserver)