Doc #70575 [Opn->Csd]: gmp_random() doc wrong
| From: | nikic@php.net | Date: | Mon, 02 Jul 2018 15:50:45 +0000 |
| Subject: | Doc #70575 [Opn->Csd]: gmp_random() doc wrong | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-15841@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=70575&edit=1
ID: 70575
Updated by: nikic@php.net
Reported by: rainer dot jung at kippdata dot de
Summary: gmp_random() doc wrong
-Status: Open
+Status: Closed
Type: Documentation Problem
Package: GNU MP related
Operating System: Any
PHP Version: 7.0.0RC3
-Assigned To:
+Assigned To: nikic
Block user comment: N
Private report: N
Previous Comments:
------------------------------------------------------------------------
[2018-07-02 15:49:59] nikic@php.net
Automatic comment from SVN on behalf of nikic
Revision: http://svn.php.net/viewvc/?view=revision&revision=345264
Log: Fix bug #70575: gmp_random() doc wrong
Implement the changes suggested by the reporter.
------------------------------------------------------------------------
[2015-10-24 04:45:46] kalle@php.net
Hi
The source pages for the PHP documentation are in SVN and can be found under:
http://svn.php.net/
In the 'phpdoc' namespace, and 'en/reference/gmp' for GMP.
We do have a more convinent online editor at:
http://edit.php.net/
You can use for quick submission for review.
Thanks for the contribution! :)
------------------------------------------------------------------------
[2015-09-24 20:40:36] rainer dot jung at kippdata dot de
Description:
------------
Docs at http://php.net/manual/en/function.gmp-random.php
say:
Generate a random number. The number will be between zero and the number of bits per limb multiplied
by limiter.
...
Generally, the number of bits in a limb is either 16 or 32, but this is not guaranteed.
The errors are:
- "number of bits per limb multiplied by limiter" is not the upper boundary of the random
number, instead it is 2**n-1, where n is "number of bits per limb multiplied by limiter"
- number of bits in a limb is in most cases 64 or 32, not 32 or 16.
Suggested correction (partly taken from docs of gmp_random_bits()):
Generate a random number. The number will be between 0 and (2 ** n) - 1, where n is the number of
bits per limb multiplied by limiter.
...
Generally, the number of bits in a limb is either 64 or 32, but this is not guaranteed.
If you mind: where are the sources for the man pages (git URL or similar)? I could then attach a
patch.
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=70575&edit=1