[Mpfi-commits] r612 - in trunk/mpfi: src tests

ptheveny at users.gforge.inria.fr ptheveny at users.gforge.inria.fr
Jeu 22 Déc 17:30:31 CET 2011


Author: ptheveny
Date: 2011-12-22 17:30:30 +0100 (Thu, 22 Dec 2011)
New Revision: 612

Modified:
   trunk/mpfi/src/sub_fr.c
   trunk/mpfi/tests/sub_fr.dat
Log:
[sub_fr.c] Fix bug.

Modified: trunk/mpfi/src/sub_fr.c
===================================================================
--- trunk/mpfi/src/sub_fr.c	2011-12-22 16:30:29 UTC (rev 611)
+++ trunk/mpfi/src/sub_fr.c	2011-12-22 16:30:30 UTC (rev 612)
@@ -34,9 +34,6 @@
   if (MPFR_IS_ZERO (c)) {
     return mpfi_set (a, b);
   }
-  else if (MPFI_IS_ZERO (b)) {
-    return mpfi_neg (a, c);
-  }
   else {
     mpfr_init2 (tmp, mpfr_get_prec (&(a->left)));
     inexact_left = mpfr_sub (tmp, &(b->left), c, MPFI_RNDD);

Modified: trunk/mpfi/tests/sub_fr.dat
===================================================================
--- trunk/mpfi/tests/sub_fr.dat	2011-12-22 16:30:29 UTC (rev 611)
+++ trunk/mpfi/tests/sub_fr.dat	2011-12-22 16:30:30 UTC (rev 612)
@@ -82,6 +82,11 @@
 0 53 +inf  nan                      53 +inf  nan   53  0
 0 53 +inf  nan                      53 +inf  nan   53  0x170ef54646d497p-109
 
+# bug20111222
+3 53 -0x170ef54646d497p-109 -0x170ef54646d498p-109
+  53 +0                     -0
+  54  0x170ef54646d4978p-109
+
 # regular values
 0 53 -0x1fb53d14aa9c2fp-47  -0x18353d14aa9c2fp-47
   53 -32                    -17




More information about the Mpfi-commits mailing list