Re:Ten Ways to Check if an Integer Is a Power Of Two in C
by btilly on Tuesday July 26, 2011 @10:56AM
(#2807613)
Most of the solutions explicitly assume 32 bit integers. These days most of us have 64 bit integers available.
[ Parent
| on HN ]
Re:Ten Ways to Check if an Integer Is a Power Of Two in C
by lambda_cube on Tuesday July 26, 2011 @02:35PM
(#2808782)
Yes, but the two best solutions don't. The other solutions are mostly for educational purposes, I guess. One of #9 or #10 is the one that should be in some utility library.