Blimey, I should really know how to do this - I seem to be suffering from brainfade today. :/
Anyway, given a random integer value, how would you calculate the next highest ^2 value, but only if the value isn't already a ^2 number?
I did come up with the following - which I cobbled together from stuff in the docs. It seems to work, but I'm not too sure how (maths not being my favourite subject) :P
So, is there a simpler way?
Anyway, given a random integer value, how would you calculate the next highest ^2 value, but only if the value isn't already a ^2 number?
I did come up with the following - which I cobbled together from stuff in the docs. It seems to work, but I'm not too sure how (maths not being my favourite subject) :P
Function pow2(x) Return 1 Shl (Ceil(Log(x) / Log(2))) End Function
So, is there a simpler way?