In Go, NaN does not equal NaN
It's false, it returns false.
``` go
fmt.Println(math.NaN == math.NaN)
```
Don't fret though, there is a function that can tell you whether or not a value is `NaN`.
``` go
fmt.Println(math.IsNaN(math.Log(-1.0)))
```
The above returns true and all is well with the world. Don't use math.NaN as a sentinel value, it does not work, use the `math.IsNaN` function.
chriserin
March 8, 2018