.gitignore added
[dotfiles/.git] / .config / coc / extensions / coc-go-data / tools / pkg / mod / honnef.co / go / tools@v0.1.1 / staticcheck / testdata / src / CheckNaNComparison / CheckNaNComparison.go
diff --git a/.config/coc/extensions/coc-go-data/tools/pkg/mod/honnef.co/go/tools@v0.1.1/staticcheck/testdata/src/CheckNaNComparison/CheckNaNComparison.go b/.config/coc/extensions/coc-go-data/tools/pkg/mod/honnef.co/go/tools@v0.1.1/staticcheck/testdata/src/CheckNaNComparison/CheckNaNComparison.go
new file mode 100644 (file)
index 0000000..d601e3a
--- /dev/null
@@ -0,0 +1,17 @@
+package pkg
+
+import "math"
+
+func fn(f float64) {
+       _ = f == math.NaN() // want `no value is equal to NaN`
+       _ = f > math.NaN()  // want `no value is equal to NaN`
+       _ = f != math.NaN() // want `no value is equal to NaN`
+}
+
+func fn2(f float64) {
+       x := math.NaN()
+       if true {
+               if f == x { // want `no value is equal to NaN`
+               }
+       }
+}