def ratio_of
import mlbend-metrics@0.1.0.0/main.bend as MlbendMetricsimport Base
151# the ratio a over b, or 0.0 when b is zero
152def ratio_of(z: Bool, +a: Nat, +b: Nat) -> F32:
153 match z:
154 case True{}:
155 0.0
156 case False{}:
157 (F32.from_nat(a) / F32.from_nat(b) : F32)