Compare floating point numbers



examples/numbers/compare-floats/src/main.rs
fn main() {
    let x = 1.0;
    let y = 2.0;
    let z = 1.0;

    println!("{}", x < y);
    println!("{}", x == z);
    println!();


    let x = 0.1 + 0.2;
    let y = 0.3;
    println!("{}", x);
    println!("{}", y);
    println!("{}", x == y);
}

true
true

0.30000000000000004
0.3
false