Bug->Doc #61643 [Opn->Ana]: gmp_nextprime and gmp_dcdext behavior differences
| From: | ab@php.net | Date: | Mon, 13 May 2013 07:29:00 +0000 |
| Subject: | Bug->Doc #61643 [Opn->Ana]: gmp_nextprime and gmp_dcdext behavior differences | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-9810@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: ab@php.net
Reported by: mattficken@php.net
Summary: gmp_nextprime and gmp_dcdext behavior differences
-Status: Open
+Status: Analyzed
-Type: Bug
+Type: Documentation Problem
Package: GNU MP related
PHP Version: 5.4.1RC1
Block user comment: N
Private report: N
New Comment:
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.
Previous Comments:
------------------------------------------------------------------------
[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