This is the solution for anyone else interested
Just as a matter of precision for someone who is not a math guru:
log(x)/log(2) = log_based_2(x) (log being a log based on any positive number)
so of course log(x)%log(2) ---> If 0, then the log based 2 of x is an integer, and so x is a power of 2
I'm not sure of the actual precision of the value of log(2) is stored, so keep that in mind too