Re: [PATCH 5/6] Use floating point for --dirstat percentages
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Apr 26, 2011, 16:52 UTC
- Message-ID
- <7vpqo9ez03.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <1303776102-9085-6-git-send-email-johan@herland.net>
Johan Herland <johan@herland.net> writes:
> Allow specifying --dirstat cut-off percentage as a floating point number. > > When printing the dirstat output, floating point numbers are presented in > rounded form (as opposed to truncated).
Why isn't it sufficient to change
permille = this_dir * 1000 / changed
to
permille = (this_dir * 2000 + changed) / (changed * 2)
or something? If rounding is the only issue that bothers you (I admit that it does bother me, now that you brought it up), that is.