def num

lawful-fields@0.1.1.0 · fields.bend:66

import lawful-fields@0.1.1.0/fields.bend as Fields
import Base
import lawful-bytes@0.1.1.0/defs.bend as D
import lawful-bytes@0.1.1.0/bytes.bend as B

66# The decimal number in bytes from .. to-1, if it is one and below 2^32.
67def num(b: D.Bytes, +from: U32, +to: U32) -> D.Bytes & Maybe<&2, U32>:
68  num.go(Nat.sub(U32.to_nat(to), U32.to_nat(from)), B.at(b, from), from, 0, U32.is_lt(from, to))

Uses (9)

Used by (8)