summary refs log tree commit diff
path: root/tests/ui/match/match-float.rs
blob: f8514568d157cf154c37b03ed5c6c30b2327b60e (plain)
1
2
3
4
5
6
7
8
9
10
11
//@ run-pass
// Makes sure we use `==` (not bitwise) semantics for float comparison.

fn main() {
    const F1: f32 = 0.0;
    const F2: f32 = -0.0;
    assert_eq!(F1, F2);
    assert_ne!(F1.to_bits(), F2.to_bits());
    assert!(matches!(F1, F2));
    assert!(matches!(F2, F1));
}