[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[commits] r11712 - in /libdfp/trunk: ChangeLog printf_dfp.c tests/test-printf.c



Author: ryanarn
Date: Thu Oct  7 09:27:15 2010
New Revision: 11712

Log:
2010-10-07  Ryan S. Arnold  <rsa@xxxxxxxxxx>

	* tests/test-printf.c (printf_d128s): Added 0.9999999999DL which
	reported 0.100000 rather than 1.000000 and was fixed by Andreas'
	patch from 2010-10-04.

2010-10-04  Andreas Schwab  <schwab@xxxxxxxxxx>

	* printf_dfp.c (__printf_dfp): Fix up nd when rounding overflows
	beyond first digit.


Modified:
    libdfp/trunk/ChangeLog
    libdfp/trunk/printf_dfp.c
    libdfp/trunk/tests/test-printf.c

Modified: libdfp/trunk/ChangeLog
==============================================================================
--- libdfp/trunk/ChangeLog (original)
+++ libdfp/trunk/ChangeLog Thu Oct  7 09:27:15 2010
@@ -1,3 +1,14 @@
+2010-10-07  Ryan S. Arnold  <rsa@xxxxxxxxxx>
+
+	* tests/test-printf.c (printf_d128s): Added 0.9999999999DL which
+	reported 0.100000 rather than 1.000000 and was fixed by Andreas'
+	patch from 2010-10-04.
+
+2010-10-04  Andreas Schwab  <schwab@xxxxxxxxxx>
+
+	* printf_dfp.c (__printf_dfp): Fix up nd when rounding overflows
+	beyond first digit.
+
 2010-08-25  Luis Machado  <luisgpm@xxxxxxxxxx>
 
 	* sysdeps/soft-dfp/floatsisd.c: Don't generate additional decimal

Modified: libdfp/trunk/printf_dfp.c
==============================================================================
--- libdfp/trunk/printf_dfp.c (original)
+++ libdfp/trunk/printf_dfp.c Thu Oct  7 09:27:15 2010
@@ -697,8 +697,8 @@
 	  }
 
 	while (digits[--index] == '9') digits[index] = '0';
-	  digits[index]++;
-	if (index < n) { n--; }
+	digits[index]++;
+	if (index < n) { n--; nd++; }
       } while (0);
     } /* Done rounding.  */
 

Modified: libdfp/trunk/tests/test-printf.c
==============================================================================
--- libdfp/trunk/tests/test-printf.c (original)
+++ libdfp/trunk/tests/test-printf.c Thu Oct  7 09:27:15 2010
@@ -701,6 +701,9 @@
 
   {__LINE__, 6543.00DL, " 6543.00", "%8DDa"},
 
+  /* Fixed by Andreas Schwab on 2010-20-04 */
+  {__LINE__, 0.9999999999DL, "1.000000", "%DDf"},
+
   {0,0,0,0 }
 };