From: Christian Couder Date: Thu, 19 Feb 2009 05:26:35 GMT Subject: Re: [PATCH] rev-list: estimate number of bisection step left Message-ID: <200902190626.36163.chriscool@tuxfamily.org> In-Reply-To: <200902190616.18747.chriscool@tuxfamily.org> Le jeudi 19 février 2009, Christian Couder a écrit : > So the improved algorithm could be something like: > > static int estimate_bisect_steps(int all) > { > int n, x, e; > float p; Oops, the line above is not needed. > if (all < 3) > return 0; > > n = log2(all); > e = exp2(n); > x = all - e; > > return (e < 3 * x) ? n : n - 1 ; > }