def bit
import lawful-words@0.1.0.0/defs.bend as Defsimport Base
16# Bit k of a word (bit 0 is the lowest; every bit from 32 up is 0).
17def bit(a: U32, k: Nat) -> Bool:
18 Nat.is_eq(Nat.mod(Nat.div(U32.to_nat(a), Nat.pow(2n, k)), 2n), 1n)
import lawful-words@0.1.0.0/defs.bend as Defsimport Base
16# Bit k of a word (bit 0 is the lowest; every bit from 32 up is 0).
17def bit(a: U32, k: Nat) -> Bool:
18 Nat.is_eq(Nat.mod(Nat.div(U32.to_nat(a), Nat.pow(2n, k)), 2n), 1n)