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 the limit as x goes to negative > infinity as log (0) / log(2) is undefined). I tested out his claim and > he was right:
That's kind of obvious given the code. I think that this might be an intentional optimization. I guess that it doesn't really make sense to apply powerof2 to zero and the users of the macro should do the check on their own if they expect zero as input (many places in the do not allow that). -- Andriy Gapon _______________________________________________ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "freebsd-hackers-unsubscr...@freebsd.org"