OH for crying out loud Here are two no-assembly, portable algorythms i use, first one i came up with, it's based on idea of second algorythm, which is from wikipedia (or the other way round).

Code:
if &#40;number and &#40;number - 1&#41; <> 0&#41; // FAST POT CHECK

trunc&#40;power&#40;2, trunc&#40;Log2&#40;number&#41;&#41;&#41;&#41;; // MAKE NUMBER A POT, ROUND UP