[PATCH v4] string_helpers: fix precision loss for some inputs

2015-11-06 Thread James Bottomley
From: James Bottomley It was noticed that we lose precision in the final calculation for some inputs. The most egregious example is size=3000 blk_size=1900 in units of 10 should yield 5.70 MB but in fact yields 3.00 MB (oops). This is because the current algorithm doesn't correctly account for

[PATCH v4] string_helpers: fix precision loss for some inputs

2015-11-06 Thread James Bottomley
From: James Bottomley It was noticed that we lose precision in the final calculation for some inputs. The most egregious example is size=3000 blk_size=1900 in units of 10 should yield 5.70 MB but in fact yields 3.00 MB (oops). This is because the current algorithm doesn't