navid/haze / ce973bf670639d0fedbf32c4f2b98a06c255e5a32665fdec796c0884678b96bf / samples/baseline_2.2/short_circuit_zero_division.hz

short_circuit_zero_division.hz

← samples/baseline_2.2 · 126 bytes · raw · download

pure fn guarded(d i32) i32
    : pre d == 0 || 10 / d > 0
    => d

fn main() {
    print(guarded(0))
    print(guarded(2))
}