Skip to main content

Try it Live

Run Uint examples in the interactive playground

Uint.bitwiseAnd(a: BrandedUint256, b: BrandedUint256): BrandedUint256

Bitwise AND operation. Parameters:
  • a: BrandedUint256 - First value
  • b: BrandedUint256 - Second value
Returns: BrandedUint256 - Bitwise AND result Example:
import { Uint } from 'tevm'

const a = Uint(0b1100n)
const b = Uint(0b1010n)
Uint.bitwiseAnd(a, b)  // 0b1000 (8)

// Masking
const value = Uint(0xffn)
const mask = Uint(0x0fn)
Uint.bitwiseAnd(value, mask)  // 0x0f
Defined in: primitives/Uint/bitwiseAnd.ts

See Also