News for hackers. Stuff that matters.
Re:Write A Function To Determine If A Number Is A Power Of 2 by leif on Monday October 18, 2010 @12:18PM (#1804046)
Did anyone else think "don't you just check if it's on the positive real axis?"
Re:Write A Function To Determine If A Number Is A Power Of 2 by mchouza on Monday October 18, 2010 @08:55PM (#1805761)
Well... we can just check if it's nonzero. They didn't say real power of 2. :-)
Re:Write A Function To Determine If A Number Is A Power Of 2 by leif on Tuesday October 19, 2010 @12:17AM (#1806191)
silly me
Re:Write A Function To Determine If A Number Is A Power Of 2 by Natsu on Monday October 18, 2010 @05:23PM (#1805217)
Yes. I was thinking through the test case of 1 (2^0) when I realized that they never asked for an integer power of 2...