Re: [PATCH] Bug with powerof2 macro in sys/param.h

2010-10-15 Thread b. f.
>We aren't dealing with mathematicians, but programmers. I am attempting to reconcile this with Colin's rationale in terms of congruence classes over rings Z/nZ. ;) b. ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinf

Re: [PATCH] Bug with powerof2 macro in sys/param.h

2010-10-15 Thread Garrett Cooper
On Fri, Oct 15, 2010 at 5:51 AM, John Baldwin wrote: > On Thursday, October 14, 2010 11:49:23 pm Garrett Cooper wrote: >> On Thu, Oct 14, 2010 at 6:37 AM, John Baldwin wrote: >> > On Thursday, October 14, 2010 7:58:32 am Andriy Gapon wrote: >> >> on 14/10/2010 00:30 Garrett Cooper said the follow

Re: [PATCH] Bug with powerof2 macro in sys/param.h

2010-10-15 Thread John Baldwin
On Thursday, October 14, 2010 11:49:23 pm Garrett Cooper wrote: > On Thu, Oct 14, 2010 at 6:37 AM, John Baldwin wrote: > > On Thursday, October 14, 2010 7:58:32 am Andriy Gapon wrote: > >> on 14/10/2010 00:30 Garrett Cooper said the following: > >> > I was talking to someone today about this m

Re: [PATCH] Bug with powerof2 macro in sys/param.h

2010-10-15 Thread Colin Percival
Garrett Cooper wrote: > I was talking to someone today about this macro, and he noted that > the algorithm is incorrect -- it fails the base case with ((x) == 0 -- > which makes sense because 2^(x) cannot equal 0 (mathematically > impossible, unless you consider the limit as x goes to negative

Re: [PATCH] Bug with powerof2 macro in sys/param.h

2010-10-14 Thread Garrett Cooper
On Thu, Oct 14, 2010 at 6:37 AM, John Baldwin wrote: > On Thursday, October 14, 2010 7:58:32 am Andriy Gapon wrote: >> on 14/10/2010 00:30 Garrett Cooper said the following: >> >     I was talking to someone today about this macro, and he noted that >> > the algorithm is incorrect -- it fails the

Re: [PATCH] Bug with powerof2 macro in sys/param.h

2010-10-14 Thread John Baldwin
On Thursday, October 14, 2010 7:58:32 am Andriy Gapon wrote: > on 14/10/2010 00:30 Garrett Cooper said the following: > > I was talking to someone today about this macro, and he noted that > > the algorithm is incorrect -- it fails the base case with ((x) == 0 -- > > which makes sense because 2

Re: [PATCH] Bug with powerof2 macro in sys/param.h

2010-10-14 Thread Andriy Gapon
on 14/10/2010 00:30 Garrett Cooper said the following: > I was talking to someone today about this macro, and he noted that > the algorithm is incorrect -- it fails the base case with ((x) == 0 -- > which makes sense because 2^(x) cannot equal 0 (mathematically > impossible, unless you consider

[PATCH] Bug with powerof2 macro in sys/param.h

2010-10-13 Thread Garrett Cooper
I was talking to someone today about this macro, and he noted that the algorithm is incorrect -- it fails the base case with ((x) == 0 -- which makes sense because 2^(x) cannot equal 0 (mathematically impossible, unless you consider the limit as x goes to negative infinity as log (0) / log(2) i