def F32.round

Base · base.bend:1899

import Base
1899def F32.round(a: F32) -> F32:
1900  match a:
1901    case F32{+x}:
1902      +f = F32.floor(F32{x})
1903      +r = F32.add(f, Bool.pick(F32, F32.is_ge(F32.sub(F32{x}, f), 0.5), 1.0, 0.0))
1904      F32.round.zero(F32{x}, r, F32.is_eq(r, 0.0))

Uses (8)

Used by (3)