Skip to main content

Try it Live

Run Uint examples in the interactive playground

Uint.bitwiseNot(value: BrandedUint256): BrandedUint256

Bitwise NOT (complement) operation - flips all bits. Parameters:
  • value: BrandedUint256 - Value to invert
Returns: BrandedUint256 - Bitwise NOT result Example:
import { Uint } from 'tevm'

const a = Uint(0xfn)
Uint.bitwiseNot(a)  // 0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0

Uint.bitwiseNot(Uint.ZERO)  // MAX
Uint.bitwiseNot(Uint.MAX)   // ZERO
Defined in: primitives/Uint/bitwiseNot.ts

See Also