ID:              40408
 User updated by: burg1 at gmx dot net
 Reported By:     burg1 at gmx dot net
 Status:          Bogus
 Bug Type:        Documentation problem
 PHP Version:     Irrelevant
 New Comment:

3) Yes, but maybe you could state explicitly that mt_rand() "generates
a better random value".
Currently, the first link ("If you require a range larger...") misses
this point and the second link ("See also") is too unspecific.


Previous Comments:
------------------------------------------------------------------------

[2007-03-23 17:20:11] [EMAIL PROTECTED]

1) max can be higher than getrandmax(). Random number however will have
only granularity of getrandmax().

2) No.

3) mt_rand() is already linked from the page.


------------------------------------------------------------------------

[2007-02-08 20:36:46] burg1 at gmx dot net

Description:
------------
I'm suggestion to revise this sentence in the docs:
"If you require a range larger than 32768, specifying min and max will
allow you to create a range larger than RAND_MAX, or consider using
mt_rand() instead."

1) As far as I can see, the max parameter cannot be larger than
getrandmax(), otherwise rand() always returns 0. Please mention this
limit! (I'm not sure if this behavior is platform-depended or due to
PHP-internal integer handling, so I cannot suggest a reformulation.)

2) As far as I can see, this limit also applies to mt_rand(), so the
last subsentence "or consider using mt_rand() instead" doesn't make
sense to me.

3) Since mt_rand generates a "better random value", please include an
explicit Note about this fact.



------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=40408&edit=1

Reply via email to