News for hackers. Stuff that matters.
Re:Write A Function To Determine If A Number Is A Power Of 2 by sad on Monday October 18, 2010 @12:26PM (#1804082)
Yes, but we must solve the problems correctly. The question is whether a number is a power of two, not divisible by 2.
Re:Write A Function To Determine If A Number Is A Power Of 2 by yan on Monday October 18, 2010 @12:27PM (#1804088)
I think Ed wrote the first line of a function, not all of it. See the iterative solution in the posted article.
Re:Write A Function To Determine If A Number Is A Power Of 2 by sad on Monday October 18, 2010 @12:31PM (#1804107)
Ohh, looks like you are probably right. Mea culpa!