Delta

Untitled

Apr 25th, 2011
236
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.19 KB | None | 0 0
  1. javascript:
  2. function PowerOfTwo(n)
  3. {
  4. for(var I = 1; I < 32; I++)
  5. if(!(n ^ 0x01 << I))
  6. return true;
  7.  
  8. return false;
  9. }
  10. var n = parseInt(prompt());
  11. alert(PowerOfTwo(n));
  12. void null;
Advertisement
Add Comment
Please, Sign In to add comment