mirror of
https://git.savannah.gnu.org/git/coreutils.git
synced 2026-11-19 03:33:43 +03:00
(human_readable): Fix bug that rounded 10501 to 10k.
Bug reported by Lute Kamstra in <http://mail.gnu.org/archive/html/bug-gnulib/2003-09/msg00003.html>.
This commit is contained in:
1 parent
c8b7d2500d
commit
a42a4b7bd3
1 file changed
+3
-5
+3
-5
@@ -355,11 +355,9 @@ human_readable (uintmax_t n, char *buf, int opts,
|
||||
}
|
||||
}
|
||||
|
||||
if (inexact_style == human_ceiling
|
||||
? 0 < tenths + rounding
|
||||
: inexact_style == human_round_to_nearest
|
||||
? 5 < tenths + (2 < rounding + (amt & 1))
|
||||
: /* inexact_style == human_floor */ 0)
|
||||
if (inexact_style == human_round_to_nearest
|
||||
? 5 < tenths + (0 < rounding + (amt & 1))
|
||||
: inexact_style == human_ceiling && 0 < tenths + rounding)
|
||||
{
|
||||
amt++;
|
||||
|
||||
|
||||
Reference in new issue
Block a user