From: Johannes Schindelin Date: Sun, 05 Mar 2006 23:36:03 GMT Subject: Re: [PATCH] blame: avoid -lm by not using log(). Message-ID: 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