How can I check whether a float variable is NaN or not? e.g.
math.Log(1.0) // not NaN math.Log(-1.0) // NaN
Use math.IsNaN(...) for that: playground
math.IsNaN(...)
Use math.IsNaN:
math.IsNaN
IsNaN reports whether f is an IEEE 754 “not-a-number” value.