def bitw.test

bend-osdev-algo@0.1.0.0 · algo.bend:25

import bend-osdev-algo@0.1.0.0/algo.bend as Algo
import Base

25# bit k (False at or past the width)
26def bitw.test(n: Nat, w: Word(n), k: Nat) -> Bool:
27  match n:
28    case 0n:
29      False{}
30    case 1n+p:
31      match w k:
32        case WCon{b, t} 0n:
33          b
34        case WCon{b, t} 1n+j:
35          bitw.test(p, t, j)

Uses (4)

Used by (11)