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

2010-10-15 Thread Colin Percival
Garrett Cooper gcoo...@freebsd.org 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

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 j...@freebsd.org 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

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 j...@freebsd.org wrote: On Thursday, October 14, 2010 11:49:23 pm Garrett Cooper wrote: On Thu, Oct 14, 2010 at 6:37 AM, John Baldwin j...@freebsd.org wrote: On Thursday, October 14, 2010 7:58:32 am Andriy Gapon wrote: on 14/10/2010 00:30 Garrett

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

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

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^(x)

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 j...@freebsd.org 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

[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)