com php-src: We can't output absolute S and T values for the Diophantine solution here since it can vary based on the libgmp version we are linking
against and in general there are almost always multiple valid solutions: ext/gmp/tests/gmp_gcdext.phpt
| From: | Rasmus Lerdorf | Date: | Sat, 10 Jan 2015 00:23:50 +0000 |
| Subject: | com php-src: We can't output absolute S and T values for the Diophantine solution here since it can vary based on the libgmp version we are linking against and in general there are almost always multiple valid solutions: ext/gmp/tests/gmp_gcdext.phpt |
||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-84051@lists.php.net to get a copy of this message | ||
Commit: 46f429f8e611ef85c22224cddb3ea0727dbb6bd4
Author: Rasmus Lerdorf <rasmus@php.net> Fri, 9 Jan 2015 16:23:50 -0800
Parents: 287217a3a34f0bc0e0d0f278f9915bf5163c6044
Branches: PHP-5.6
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=46f429f8e611ef85c22224cddb3ea0727dbb6bd4
Log:
We can't output absolute S and T values for the
Diophantine solution here since it can vary based
on the libgmp version we are linking against and
in general there are almost always multiple valid
solutions
Changed paths:
M ext/gmp/tests/gmp_gcdext.phpt
Diff:
diff --git a/ext/gmp/tests/gmp_gcdext.phpt b/ext/gmp/tests/gmp_gcdext.phpt
index 469aa30..57fb058 100644
--- a/ext/gmp/tests/gmp_gcdext.phpt
+++ b/ext/gmp/tests/gmp_gcdext.phpt
@@ -24,9 +24,9 @@ $a = array(
foreach ($a as $val) {
$r = gmp_gcdext($val[0],$val[1]);
+ $check = gmp_add(gmp_mul($val[0],$r['s']), gmp_mul($val[1],$r['t']));
var_dump(gmp_strval($r['g']));
- var_dump(gmp_strval($r['s']));
- var_dump(gmp_strval($r['t']));
+ var_dump(gmp_strval($check));
}
var_dump(gmp_gcdext($val[0],array()));
@@ -39,35 +39,25 @@ echo "Done\n";
?>
--EXPECTF--
string(1) "3"
-string(2) "-4"
-string(2) "11"
+string(1) "3"
+string(1) "1"
string(1) "1"
-string(4) "-805"
-string(3) "359"
string(1) "3"
-string(2) "32"
-string(5) "-2257"
+string(1) "3"
string(4) "3003"
-string(3) "-10"
-string(2) "19"
+string(4) "3003"
+string(1) "2"
string(1) "2"
-string(2) "67"
-string(2) "-3"
string(2) "15"
-string(7) "-601519"
-string(1) "6"
+string(2) "15"
+string(3) "345"
string(3) "345"
string(1) "1"
-string(1) "0"
string(1) "1"
-string(5) "84319"
-string(9) "-84241831"
string(1) "1"
-string(13) "-156252240050"
-string(14) "16689072773537"
+string(1) "1"
+string(3) "195"
string(3) "195"
-string(11) "46994884483"
-string(9) "-68772552"
Warning: gmp_gcdext(): Unable to convert variable to GMP - wrong type in %s on line %d
bool(false)