Re: Better name for method Randomizer::nextFloat()
| From: | G. P. B. | Date: | Mon, 16 Oct 2023 12:26:26 +0000 |
| Subject: | Re: Better name for method Randomizer::nextFloat() | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-121333@lists.php.net to get a copy of this message | ||
On Mon, 16 Oct 2023 at 09:34, Christian Schneider <cschneid@cschneid.com>
wrote:
> > Side note: The implementation of nextFloat() is much more efficient than
> that of getFloat(0.0, 1.0) and the output will differ even for the same
> seeded engine. The domain of legal return values is identical.
>
> This sounds like an implementation detail as I'm pretty sure you could
> switch to that fast path easily enough if neither of the arguments were
> given.
>
This is not how the engine works, it would require an if-clause on every
single call of getFloat() that would probably defeat the point of it.
Best regards,
George P. Banyard