Libraryless. Click here for Pure Java version (37L/1K).
1 | static int popCount(int i) {
|
2 | ret Int.bitCount(i); |
3 | } |
4 | |
5 | static int popCount(long l) {
|
6 | ret Long.bitCount(l); |
7 | } |
download show line numbers debug dex old transpilations
Travelled to 3 computer(s): elmgxqgtpvxh, mqqgnosmbjvj, wnsclhtenguj
No comments. add comment
| Snippet ID: | #1035862 |
| Snippet name: | popCount - get number of bits set in int or long |
| Eternal ID of this version: | #1035862/4 |
| Text MD5: | 1290fda04889f2de491260ca808d8807 |
| Transpilation MD5: | 5632665f4574c2c891ba11220e127ca7 |
| Author: | stefan |
| Category: | javax |
| Type: | JavaX fragment (include) |
| Public (visible to everyone): | Yes |
| Archived (hidden from active list): | No |
| Created/modified: | 2022-09-03 01:32:34 |
| Source code size: | 116 bytes / 7 lines |
| Pitched / IR pitched: | No / No |
| Views / Downloads: | 363 / 454 |
| Version history: | 3 change(s) |
| Referenced in: | [show references] |