From: Johannes Schindelin Date: Fri, 09 Feb 2007 00:47:53 GMT Subject: Re: [PATCH] format-patch -n: make sorting easier by padding number Message-ID: In-Reply-To: Hi, On Fri, 9 Feb 2007, Johannes Schindelin wrote: > +static unsigned int log10(unsigned int number) > +{ > + unsigned int i = 10, result = 1; > + while (i < number) { D'oh. Make that "<=", please. > + i *= 10; > + result++; > + } > + return result; > +} Ciao, Dscho