Doc #61643 [Ana->Csd]: gmp_nextprime and gmp_dcdext behavior differences
| From: | cmb@php.net | Date: | Sun, 29 Apr 2018 11:14:49 +0000 |
| Subject: | Doc #61643 [Ana->Csd]: gmp_nextprime and gmp_dcdext behavior differences | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-15630@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=61643&edit=1
ID: 61643
Updated by: cmb@php.net
Reported by: mattficken@php.net
Summary: gmp_nextprime and gmp_dcdext behavior differences
-Status: Analyzed
+Status: Closed
Type: Documentation Problem
Package: GNU MP related
PHP Version: 5.4.1RC1
-Assigned To:
+Assigned To: cmb
Block user comment: N
Private report: N
New Comment:
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.
Thank you for the report, and for helping us make our documentation better.
Previous Comments:
------------------------------------------------------------------------
[2018-04-29 11:14:15] cmb@php.net
Automatic comment from SVN on behalf of cmb
Revision: http://svn.php.net/viewvc/?view=revision&revision=344880
Log: Fix #61643: gmp_nextprime and gmp_dcdext behavior differences
------------------------------------------------------------------------
[2013-05-13 07:28:59] ab@php.net
I'm using this snippet to test on both Windows and Linux
#include <gmp.h>
int main (void) {
mpz_t p;
mpz_init_set_str(p, "-1000", 10);
mpz_nextprime(p, p);
gmp_printf("mpz_nextprime : %Zd\n", p);
return 0;
}
It looks like the correct answer is 2, on both windows mpir 2.5.1 and 2.6.0 and
linux with
gmp. The tests are also pass now, the doc is wrong.
------------------------------------------------------------------------
[2012-04-05 21:21:07] mattficken@php.net
Description:
------------
022.phpt which tests gmp_gcdext() and gmp_nextprime.phpt which tests gmp_nextprime() fail on Windows
but pass on Linux.
The returned value of both of those functions in some cases doesnât match the expected value(in
some cases it does).
In example #1 in the documentation for gmp_nextprime() (http://us3.php.net/gmp_nextprime),
gmp_nextprime(-1000) returns -997 however on Linux it returns 2, which is what the test expects so
the test passes.
Not only is this a behavior difference between Windows and Linux but is not what the documentation
states ( gmp_nextprime(-1000) => -997 not 2).
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=61643&edit=1