Standard library / math
math.IsNaN()
Tests whether a value is NaN; equality cannot reliably test NaN. Expected stdout: 'true\n'.
Formal Syntax & Structure
go syntaxgo
func IsNaN(f float64) (is bool)Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| f | float64 | Input floating-point value. |
Return Value
(is bool)
Tests whether a value is NaN; equality cannot reliably test NaN.
Working Example
Example Snippetgo
package main
import ( "fmt" "math")
func main() { fmt.Println(math.IsNaN(math.NaN()))}