Here's the approach:
If , return false (powers of two are positive)
While , check if
If remainder is not , return false
Otherwise, divide by and continue
If the loop completes (), return true
##### ###### ##### ### # # ### # # ###### ## ## ## ## ## ## ## # # # # # ## ##### #### ##### # # # # # # # #### ## # ## ## ## ## # # # # # ## ## # ###### ## ### # ### # ######
##### ###### ##### ### # # ### # # ###### ## ## ## ## ## ## ## # # # # # ## ##### #### ##### # # # # # # # #### ## # ## ## ## ## # # # # # ## ## # ###### ## ### # ### # ######
Step by step approach
Here's the approach:
If , return false (powers of two are positive)
While , check if
If remainder is not , return false
Otherwise, divide by and continue
If the loop completes (), return true