main.rs
mod fractions;
mod test;
use fractions::Fraction;
fn main() {
let half = Fraction::new(1, 2).unwrap();
let quarter = Fraction::new(1, 4).unwrap();
let three_quarters = half + quarter;
let three = three_quarters / quarter;
println!("Half is: {half}");
println!("Quarter is: {quarter}");
println!("Three quarters is: {three_quarters}");
println!("Three is: {three}");
}
It's pretty straight forwards. Looking for some criticism and maybe imrpovement suggestions. Yes, I'm aware there are libraries like num, this is mainly for the purposes of learning. Thank you for your time!