Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1314536

Re: [PATCH v2 06/11] lib/vsprintf: introduce %pl to print in human-readable form

From "H. Peter Anvin" <hpa@zytor.com>
Newsgroups linux.kernel
Subject Re: [PATCH v2 06/11] lib/vsprintf: introduce %pl to print in human-readable form
Date 2016-01-21 22:20 +0100
Message-ID <qTuO7-2vq-23@gated-at.bofh.it> (permalink)
References <qQYz0-5b5-1@gated-at.bofh.it> <qQYz1-5b5-45@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On 01/14/16 14:23, Andy Shevchenko wrote:
> Introduce a new extension for printing given unsigned long long value in
> human-readable form with automatically choosen IEC binary prefix. The value is
> passed by reference.

Why by reference?  That seems to make little sense.

The prefix should not include the unit (e.g. B) as we may want to use
another thing.

It is also worth noting that what you have here is to generate *exact*
values, which aren't always what we want.  Another common thing is to
round/truncate to 3 significant figures in order to get the order of
magnitude clear; the prefix being so different depending on the low
order bits can be confusing when an exact representation isn't needed.

	-hpa

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

Re: [PATCH v2 06/11] lib/vsprintf: introduce %pl to print in  human-readable form "H. Peter Anvin" <hpa@zytor.com> - 2016-01-21 22:20 +0100

csiph-web