what's the easiest way to round up to power of 2?

BlitzMax Forums/BlitzMax Programming/what's the easiest way to round up to power of 2?

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

Without a loop.

Get the square root of your number. Round up the result and square it.

Square root is a slow process, so I have no idea if this would be faster or slower.