Re: rand(), mt_rand() and limits
| From: | Andrea Faulds | Date: | Mon, 12 Jan 2015 00:26:37 +0000 |
| Subject: | Re: rand(), mt_rand() and limits | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-80392@lists.php.net to get a copy of this message | ||
Hey Leigh,
> On 12 Jan 2015, at 00:23, Leigh <leight@gmail.com> wrote:
>
> On 11 January 2015 at 22:12, Andrea Faulds <ajf@ajf.me> wrote:
>> * Get rid of rand(), srand() and getrandmax()
>> * Rename mt_rand(), mt_srand() and mt_getrandmax() to rand(), srand(), and getrandmax()
>> but add mt_* aliases for backwards-compatibility
>> * Make mt_srand() and srand() do nothing and produce a deprecation notice
>> * Use a 64-bit random number generation algorithm on 64-bit platforms (or invoke the
>> 32-bit generator twice)
>>
>
> I have to object to removing the C stdlib rand(). mt_rand() is
> significantly slower and when I don't care about the "quality" of the
> random numbers the choice is obvious.
For what application do you need to generate so many random numbers that mt_rand() is too slow? Bear
in mind that rand() is only faster if you’re using a sdtlib that’s faster.
Thanks.
--
Andrea Faulds
http://ajf.me/