Bug #70575 [Opn]: gmp_random() doc wrong

From: Date: Sat, 24 Oct 2015 04:45:51 +0000
Subject: Bug #70575 [Opn]: gmp_random() doc wrong
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-12837@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: kalle@php.net Reported by: rainer dot jung at kippdata dot de Summary: gmp_random() doc wrong Status: Open Type: Bug Package: Documentation problem Operating System: Any PHP Version: 7.0.0RC3 Block user comment: N Private report: N New Comment: 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! :) Previous Comments: ------------------------------------------------------------------------ [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

« previous php.doc.bugs (#12837) next »