testBit m n returns whether the (n+1) least significant bit is 1 or 0, using the two's
complement convention for negative m.
Instances For
Construct an integer from a sequence of bits using little endian convention.
The sign is determined using the two's complement convention: the result is negative if and only if
n > 0 and f (n-1) = true.
Equations
- Int.ofBits f = if 2 * Nat.ofBits f < 2 ^ n then Int.ofNat (Nat.ofBits f) else Int.subNatNat (Nat.ofBits f) (2 ^ n)
Instances For
@[simp]
@[simp]