MlbendMetrics.ratio_of: def of mlbend-metrics@0.1.0.0 Import: import mlbend-metrics@0.1.0.0/main.bend as MlbendMetrics Lines 151-157 of mlbend-metrics@0.1.0.0/main.bend: https://jend.leeeet.dev/read.txt?path=mlbend-metrics@0.1.0.0/main.bend&start_line=151&end_line=157 import Base # the ratio a over b, or 0.0 when b is zero def ratio_of(z: Bool, +a: Nat, +b: Nat) -> F32: match z: case True{}: 0.0 case False{}: (F32.from_nat(a) / F32.from_nat(b) : F32) Uses (5): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=F32 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=F32.div https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=F32.from_nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat