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.

Hiya, say I'm given a number in the range 0-1024, what's the easiest way to round it up to the next power of 2 value (aside from having an array (or loop) or ^2 values and comparing the given value against them). Thanks!