Bit manipulation (since C23)
From cppreference.com
Functions | ||
Defined in header
<stdbit.h> | ||
(C23) |
counts the number of consecutive 0 bits, starting from the most significant bit (type-generic function macro) | |
(C23) |
counts the number of consecutive 1 bits, starting from the most significant bit (type-generic function macro) | |
(C23) |
counts the number of consecutive 0 bits, starting from the least significant bit (type-generic function macro) | |
(C23) |
counts the number of consecutive 1 bits, starting from the least significant bit (type-generic function macro) | |
finds the first position of 0 bit, starting from the most significant bit (type-generic function macro) | ||
finds the first position of 1 bit, starting from the most significant bit (type-generic function macro) | ||
finds the first position of 0 bit, starting from the least significant bit (type-generic function macro) | ||
finds the first position of 1 bit, starting from the least significant bit (type-generic function macro) | ||
(C23) |
counts the number of 0 bits in an unsigned integer (type-generic function macro) | |
(C23) |
counts the number of 1 bits in an unsigned integer (type-generic function macro) | |
(C23) |
checks if a number is an integral power of 2 (type-generic function macro) | |
(C23) |
finds the smallest number of bits needed to represent the given value (type-generic function macro) | |
(C23) |
finds the largest integral power of two not greater than the given value (type-generic function macro) | |
(C23) |
finds the smallest integral power of two not less than the given value (type-generic function macro) | |
Macro constants | ||
Defined in header
<stdbit.h> | ||
indicates the endianness of scalar types (macro constant) |
[edit] References
- C23 standard (ISO/IEC 9899:2024):
- 7.??.? Bit manipulation (p: TBD)