Patch gmp_mod for GNU MP related Bug #52906
Patch version 2010-09-22 15:43 UTC
Return to Bug #52906 |
Download this patch
Patch Revisions:
Developer: cataphract@php.net
Index: gmp.c
===================================================================
--- gmp.c (revision 302109)
+++ gmp.c (working copy)
@@ -955,7 +955,9 @@
return;
}
- gmp_zval_binary_ui_op_ex(return_value, a_arg, b_arg, mpz_mod, (gmp_binary_ui_op_t)mpz_mod_ui, 1, 1 TSRMLS_CC);
+ /* Don't use ui variant because gmp_zval_binary_ui_op_ex would attempt to change
+ * the sign of the result if the first operand was negative */
+ gmp_zval_binary_ui_op_ex(return_value, a_arg, b_arg, mpz_mod, NULL, 1, 1 TSRMLS_CC);
}
/* }}} */
|