… | |
… | |
620 | |
620 | |
621 | For example: |
621 | For example: |
622 | |
622 | |
623 | ecb_ctz32 (3) = 0 |
623 | ecb_ctz32 (3) = 0 |
624 | ecb_ctz32 (6) = 1 |
624 | ecb_ctz32 (6) = 1 |
|
|
625 | |
|
|
626 | =item int ecb_clz32 (uint32_t x) |
|
|
627 | |
|
|
628 | =item int ecb_clz64 (uint64_t x) |
|
|
629 | |
|
|
630 | =item int ecb_clz (T x) [C++] |
|
|
631 | |
|
|
632 | Counts the number of leading zero bits in C<x>. If C<x> is 0 the result is |
|
|
633 | undefined. |
|
|
634 | |
|
|
635 | The overloaded C++ C<ecb_clz> function supports C<uint32_t> and |
|
|
636 | C<uint64_t> types only. |
|
|
637 | |
|
|
638 | It is often simpler to use one of the C<ecb_ld*> functions instead, whoise |
|
|
639 | result only depends on the value and not the size of the type. |
|
|
640 | |
|
|
641 | For example: |
|
|
642 | |
|
|
643 | ecb_clz32 (3) = 30 |
|
|
644 | ecb_clz32 (6) = 29 |
625 | |
645 | |
626 | =item bool ecb_is_pot32 (uint32_t x) |
646 | =item bool ecb_is_pot32 (uint32_t x) |
627 | |
647 | |
628 | =item bool ecb_is_pot64 (uint32_t x) |
648 | =item bool ecb_is_pot64 (uint32_t x) |
629 | |
649 | |