bcache: fix rounding in human readable output
PATCH 1/1 bcache: fix rounding in human readable output
Division by 100 caused results like 3.9k < 3.10k < 4.0k; fixed by increasing the denominator to 103, which is a better approximation of 1024 / 10 == 102.4
Signed-off-by Juerd Waalboer <[email protected]>
--- drivers/md/bcache/util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/md/bcache/util.c +1 -1
@@ -88,7 +88,7 @@ ssize_t bch_hprint(char *buf, int64_t v)return sprintf (buf,"%llu" , v);if (v <100 && v >-100 ) -snprintf (dec,sizeof (dec),".%i" , t /100 ); +snprintf (dec,sizeof (dec),".%i" , t /103 );return sprintf (buf,"%lli%s%c" , v, dec, units[u]); }
Signature · 1 line
2.1.3