fn main() {
let c = div(2.0,0.0);
match c {
Ok(t) => println!("c = {t}"),
Err(e) => println!("{e}")
}
}
fn div(a:f32, b:f32) -> Result<f32, std::string::String> {
if b==0.0 {
let e = std::string::String::from("ZeroDevisionError: float division by zero");
return Err(e)
}
return Ok(a/b)
}