Re: [PATCH 5/6] Use floating point for --dirstat percentages
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Apr 27, 2011, 04:42 UTC
- Message-ID
- <7vipu0b8zy.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <201104270402.29085.johan@herland.net>
Johan Herland <johan@herland.net> writes:
Show 21 quoted lines
> On Tuesday 26 April 2011, Junio C Hamano wrote: >> 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. > > Actually, rounding doesn't bother me at all (or rather, I don't really care > if we round or truncate, as long as we're consistent).
If that is the case, I would rather not see us use floating point for this.
I have used "#define MAX_SCORE 60000.0" to sneakily run rename similarity score in floating point, feeling ashamed of it, and have been meaning to fix that for quite a long time, but other than that, I do not think we have anything that uses float.