|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2012-04-05 21:21 UTC] 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). PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 30 17:00:01 2025 UTC |
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.