def unsigned

bend-collections-laws-math@1.0.0.0 · spec/lib/numeric.bend:17

import bend-collections-laws-math@1.0.0.0/spec/lib/numeric.bend as Numeric
import Base

17def unsigned(n: Nat, w: Word(n)) -> Nat:
18  match n:
19    case 0n:
20      0n
21    case 1n+p:
22      match w:
23        case WCon{b, tail}:
24          Nat.add(bit_value(b), Nat.double(unsigned(p, tail)))

Uses (6)

Used by (4)