Libraryless. Click here for Pure Java version (75L/1K).
1 | static int numberOfBitsNeededToRepresentNOptions(int i) {
|
2 | ret 32-Int.numberOfLeadingZeros(max(0, i-1)); |
3 | } |
download show line numbers debug dex old transpilations
Travelled to 7 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv
No comments. add comment
| Snippet ID: | #1028514 |
| Snippet name: | numberOfBitsNeededToRepresentNOptions - basically a dual logarithm |
| Eternal ID of this version: | #1028514/1 |
| Text MD5: | 4226e9d2c9e9494bb13d0e9e5a142fcf |
| Transpilation MD5: | 3b73e5cb51e7f48a5c67e04015ccaf38 |
| Author: | stefan |
| Category: | javax |
| Type: | JavaX fragment (include) |
| Public (visible to everyone): | Yes |
| Archived (hidden from active list): | No |
| Created/modified: | 2020-06-23 17:48:38 |
| Source code size: | 109 bytes / 3 lines |
| Pitched / IR pitched: | No / No |
| Views / Downloads: | 520 / 650 |
| Referenced in: | [show references] |