From 23a5c823a00a3fe593813e556faccceaebfa3efe Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Wed, 6 Dec 2000 20:58:25 +0000 Subject: Update. 2000-12-06 Ulrich Drepper * stdio-common/printf_fp.c (__printf_fp): Handle decimal point in x.5 rounding correctly. --- ChangeLog | 5 +++++ stdio-common/printf_fp.c | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 4ddd487..2e27fed 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2000-12-06 Ulrich Drepper + + * stdio-common/printf_fp.c (__printf_fp): Handle decimal point in + x.5 rounding correctly. + 2000-12-06 Mark Kettenis * stdio-common/perror.c (perror): Conditionalize code dealing with diff --git a/stdio-common/printf_fp.c b/stdio-common/printf_fp.c index 2147b29..0f598d8 100644 --- a/stdio-common/printf_fp.c +++ b/stdio-common/printf_fp.c @@ -923,7 +923,9 @@ __printf_fp (FILE *fp, { wchar_t *wtp = wcp; - if (digit == L'5' && (*(wcp - 1) & 1) == 0) + if (digit == L'5' + && ((*(wcp - 1) != decimalwc && (*(wcp - 1) & 1) == 0) + || ((*(wcp - 1) == decimalwc && (*(wcp - 2) & 1) == 0)))) { /* This is the critical case. */ if (fracsize == 1 && frac[0] == 0) -- cgit v1.1