Libraryless. Click here for Pure Java version (28L/1K).
sbool isPowerOfTwo(int x) { ret (x != 0) && ((x & (x - 1)) == 0); }
download show line numbers debug dex old transpilations
Travelled to 4 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, vouqrxazstgt
No comments. add comment
Snippet ID: | #1031289 |
Snippet name: | isPowerOfTwo |
Eternal ID of this version: | #1031289/1 |
Text MD5: | 37d7b1d3deb9e497e50468496c9e0ccf |
Transpilation MD5: | 945223af5d4c4521e3959f15e88ba286 |
Author: | stefan |
Category: | javax / maths |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2021-06-03 05:21:50 |
Source code size: | 71 bytes / 3 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 215 / 280 |
Referenced in: | #1006654 - Standard functions list 2 (LIVE, continuation of #761) |