Format.round: def of bend-lawful-stdlib@0.1.0.0 Import: import bend-lawful-stdlib@0.1.0.0/src/float/format.bend as Format Lines 90-94 of bend-lawful-stdlib@0.1.0.0/src/float/format.bend: https://jend.leeeet.dev/read.txt?path=bend-lawful-stdlib@0.1.0.0/src/float/format.bend&start_line=90&end_line=94 import Base import bend-lawful-stdlib@0.1.0.0/src/float/bin.bend as Bin # the float of format f nearest to (-1)^neg * m * 2^(e - 300), ties to even def round(f: Format, neg: Bool, +m: Bin.Bin, +e: Nat) -> Val: Format{+p, emin, emax} = f +t = Nat.max(Nat.sub(Nat.add(e, Bin.len(m)), p), emin) round.go(Nat.add(emax, p), neg, m, e, t, Nat.is_le(t, e)) Uses (11): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.add https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.is_le https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.max https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.sub https://jend.leeeet.dev/definition.txt?path=bend-lawful-stdlib@0.1.0.0/src/float/bin.bend&name=Bin https://jend.leeeet.dev/definition.txt?path=bend-lawful-stdlib@0.1.0.0/src/float/bin.bend&name=len https://jend.leeeet.dev/definition.txt?path=bend-lawful-stdlib@0.1.0.0/src/float/format.bend&name=Format https://jend.leeeet.dev/definition.txt?path=bend-lawful-stdlib@0.1.0.0/src/float/format.bend&name=Val https://jend.leeeet.dev/definition.txt?path=bend-lawful-stdlib@0.1.0.0/src/float/format.bend&name=round.go