… | |
… | |
234 | equivalently the number of bits set to 0 before the least significant |
234 | equivalently the number of bits set to 0 before the least significant |
235 | bit set), starting from 0. If C<x> is 0 the result is undefined. A |
235 | bit set), starting from 0. If C<x> is 0 the result is undefined. A |
236 | common use case is to compute the integer binary logarithm, i.e., |
236 | common use case is to compute the integer binary logarithm, i.e., |
237 | floor(log2(n)). For example: |
237 | floor(log2(n)). For example: |
238 | |
238 | |
239 | ecb_ctz32(3) = 1 |
239 | ecb_ctz32(3) = 0 |
240 | ecb_ctz32(6) = 2 |
240 | ecb_ctz32(6) = 1 |
241 | |
241 | |
242 | =item int ecb_popcount32 (uint32_t x) |
242 | =item int ecb_popcount32 (uint32_t x) |
243 | |
243 | |
244 | Returns the number of bits set to 1 in C<x>. For example: |
244 | Returns the number of bits set to 1 in C<x>. For example: |
245 | |
245 | |