Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- vector<int> getBits(uint32_t input) {
- vector<int> bits;
- int bit = 0;
- while (input > 0) {
- if (input&1) {
- bits.push_back(bit);
- }
- bit++;
- input >>= 1;
- }
- return bits;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement