… | |
… | |
625 | |
625 | |
626 | =item int ecb_clz32 (uint32_t x) |
626 | =item int ecb_clz32 (uint32_t x) |
627 | |
627 | |
628 | =item int ecb_clz64 (uint64_t x) |
628 | =item int ecb_clz64 (uint64_t x) |
629 | |
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 |
630 | Counts the number of leading zero bits in C<x>. If C<x> is 0 the result is |
633 | undefined. |
631 | undefined. |
634 | |
632 | |
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 |
633 | It is often simpler to use one of the C<ecb_ld*> functions instead, whose |
639 | result only depends on the value and not the size of the type. |
634 | result only depends on the value and not the size of the type. This is |
|
|
635 | also the reason why there is no C++ overload. |
640 | |
636 | |
641 | For example: |
637 | For example: |
642 | |
638 | |
643 | ecb_clz32 (3) = 30 |
639 | ecb_clz32 (3) = 30 |
644 | ecb_clz32 (6) = 29 |
640 | ecb_clz32 (6) = 29 |