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)