def Short.near

bend-kit-fmt@0.1.0.0 · fmt.bend:222

import bend-kit-fmt@0.1.0.0/fmt.bend as Fmt
import Base

222# A tie rounds to the even digit.
223def Short.near(c: Cmp, +d: U32) -> U32:
224  match c:
225    case LT{}:
226      d
227    case GT{}:
228      U32.add(d, 1)
229    case EQ{}:
230      U32.add(d, U32.and(d, 1))

Uses (4)

Used by (1)