April 24, 2004

How do you check for powers of two?

My programming project is finished!

Within part of my program, there is a function that determines if an integer is a power of two. Does anybody know of a better way besides this? (Code sample is in C++)

Code fragment

Posted by Jeffrey at April 24, 2004 4:36 PM
What is a TrackBack? Learn more here.

TrackBack URL for this entry:
http://www.geekable.com/cgi-bin/mt-tb.cgi/164

Listed below are links to the 0 weblogs that reference 'How do you check for powers of two?' from Geekable.com.