iliaa           Wed Jan 30 18:25:51 2008 UTC

  Modified files:              (Branch: PHP_5_3)
    /php-src/ext/gmp    gmp.c 
  Log:
  
  Fixed bug #43981 (gmp_div_r() does not preserve the sign of 1st argument)
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/gmp/gmp.c?r1=1.49.2.2.2.11.2.8&r2=1.49.2.2.2.11.2.9&diff_format=u
Index: php-src/ext/gmp/gmp.c
diff -u php-src/ext/gmp/gmp.c:1.49.2.2.2.11.2.8 
php-src/ext/gmp/gmp.c:1.49.2.2.2.11.2.9
--- php-src/ext/gmp/gmp.c:1.49.2.2.2.11.2.8     Mon Dec 31 07:17:08 2007
+++ php-src/ext/gmp/gmp.c       Wed Jan 30 18:25:51 2008
@@ -569,6 +569,9 @@
        if (use_ui && gmp_ui_op) {
                if (allow_ui_return) {
                        long_result = gmp_ui_op(*gmpnum_result, *gmpnum_a, 
(unsigned long)Z_LVAL_PP(b_arg));
+                       if (mpz_sgn(*gmpnum_a) == -1) {
+                               long_result = -long_result;
+                       }
                } else {
                        gmp_ui_op(*gmpnum_result, *gmpnum_a, (unsigned 
long)Z_LVAL_PP(b_arg));
                }

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to