def tenths.mk

cswap-bend-cli@0.1.0.0 · poll.bend:89

import cswap-bend-cli@0.1.0.0/poll.bend as Poll
import Base
import cswap-bend-cli@0.1.0.0/clock.bend as Clock

89def tenths.mk(+i: String, +f: String) -> Maybe<&2, U32>:
90  do Maybe<&2, U32>:
91    ip : U32 <- U32.read(i)
92    f1 : U32 <- Clock.num(f ++ "00", 0n, 1n)
93    f2 : U32 <- Clock.num(f ++ "00", 1n, 1n)
94    return (ip * 10 + f1 + Clock.sel(U32.is_ge(f2, 5), 1, 0) : U32)

Uses (12)

Used by (1)