F32.round: def of Base Import: import Base Lines 1899-1904 of Base/base.bend: https://jend.leeeet.dev/read.txt?path=Base/base.bend&start_line=1899&end_line=1904 import Base def F32.round(a: F32) -> F32: match a: case F32{+x}: +f = F32.floor(F32{x}) +r = F32.add(f, Bool.pick(F32, F32.is_ge(F32.sub(F32{x}, f), 0.5), 1.0, 0.0)) F32.round.zero(F32{x}, r, F32.is_eq(r, 0.0)) Uses (8): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool.pick https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=F32 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=F32.add https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=F32.floor https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=F32.is_eq https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=F32.is_ge https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=F32.round.zero https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=F32.sub