Re: [PATCH] blame: avoid -lm by not using log().
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Mar 5, 2006, 23:36 UTC
- Message-ID
- <Pine.LNX.4.63.0603060032410.32270@wbgn013.biozentrum.uni-wuerzburg.de>
- In-Reply-To
- <7vhd6cechf.fsf_-_@assigned-by-dhcp.cox.net>
Hi,
On Sun, 5 Mar 2006, Junio C Hamano wrote:
> - max_digits = 1 + log(num_blame_lines+1)/log(10); > + for (max_digits = 1, i = 10; i <= num_blame_lines; max_digits++) > + i *= 10;
According to my late-night maths skills, these two methods do not do the same thing: if num_blame_lines == 9, the log method assigns 2 to max_digits, but the for loop stops at max_digits == 1. A trivial fix would be to test for i <= num_blame_lines + 1.
Ciao, Dscho