package main
import (
"fmt"
"math"
)
func main() {
// floating-point values
values := []float64{math.NaN(), 1.0, -1.0, 0.0}
for _, v := range values {
if math.IsNaN(v) {
fmt.Printf("%v is NaN\n", v)
} else {
fmt.Printf("%v is not NaN\n", v)
}
}
}
/*
run:
NaN is NaN
1 is not NaN
-1 is not NaN
0 is not NaN
*/