We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 405a1c3 commit afe7676Copy full SHA for afe7676
tests/ui/match/match-float.rs
@@ -0,0 +1,11 @@
1
+// run-pass
2
+// Makes sure we use `==` (not bitwise) semantics for float comparison.
3
+
4
+fn main() {
5
+ const F1: f32 = 0.0;
6
+ const F2: f32 = -0.0;
7
+ assert_eq!(F1, F2);
8
+ assert_ne!(F1.to_bits(), F2.to_bits());
9
+ assert!(matches!(F1, F2));
10
+ assert!(matches!(F2, F1));
11
+}
0 commit comments