MCPcopy Create free account
hub / github.com/ElementsProject/elements / LSBclear

Function LSBclear

src/simplicity/uword.h:44–46  ·  view source on GitHub ↗

Clear the 'n' least significant bits of a UWORD. * Precondition: 0 < n <= UWORD_BIT */

Source from the content-addressed store, hash-verified

42 * Precondition: 0 < n <= UWORD_BIT
43 */
44static inline UWORD LSBclear(UWORD x, size_t n) {
45 return (UWORD)(x >> 1 >> (n - 1) << 1 << (n - 1));
46}
47
48/* Clear all but the 'n' least significant bits of a UWORD.
49 * Precondition: 0 < n <= UWORD_BIT

Callers 3

frame.cFile · 0.85
copyBitsHelperFunction · 0.85
writeBitFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected