Skip to contentSkip to conversation

Recent changes (master)

PATCH Jens Axboe 1 participant 1 message Jan 10, 2021 Library code

lore
Share & tools
lore

Jens Axboe

author
#0 lore raw

The following changes since commit 8f14dc61422df3b1eaee1293a7d10ba791c8084c:

Merge branch 'cpu-engine' of https://github.com/bvanassche/fio (2021-01-07 20:53:00 -0700)

are available in the Git repository at:

git://git.kernel.dk/fio.git master

for you to fetch changes up to 674428a527931d86bfb164abcc847508b3be2742:

Merge branch 'num2str-patch' of https://github.com/gloit042/fio (2021-01-09 15:28:44 -0700)

----------------------------------------------------------------
Jens Axboe (1):
Merge branch 'num2str-patch' of https://github.com/gloit042/fio

gloit042 (1):
num2str: fix precision loss bug when the fractional part is close to 1

 lib/num2str.c | 3 +++
 1 file changed, 3 insertions(+)

---

Diff of recent changes:

lib/num2str.c +3 -0
index 3597de2f..cd89a0e5 100644
@@ -110,6 +110,9 @@ done:
 	sprintf(tmp, "%.*f", (int)(maxlen - strlen(tmp) - 1),
 		(double)modulo / (double)thousand);
 
+	if (tmp[0] == '1')
+		num++;
+
 	if (asprintf(&buf, "%llu.%s%s%s", (unsigned long long) num, &tmp[2],
 		     unitprefix[post_index], unitstr[units]) < 0)
 		buf = NULL;