def whole.pick

cswap-bend-cli@0.1.0.0 · render.bend:33

import cswap-bend-cli@0.1.0.0/render.bend as Render
import Base
import cswap-bend-cli@0.1.0.0/clock.bend as Clock

33# `{pct:>3.0f}`: tenths rounded to a whole percent, halves to even, width 3.
34def whole.pick(+w0: U32, +r: U32) -> U32:
35  Clock.sel(U32.is_gt(r, 5), (w0 + 1 : U32), Clock.sel(U32.is_eq(r, 5), (w0 + (w0 % 2) : U32), w0))

Uses (6)

Used by (1)