Standard library / math/cmplx

cmplx.NaN()

Returns complex NaN with both components NaN. Expected stdout: 'true\n'.

Formal Syntax & Structure

go syntaxgo
func NaN() complex128

Return Value

complex128

Returns complex NaN with both components NaN.

Working Example

Example Snippetgo
package main
import (  "fmt"  "math/cmplx")
func main() {  z := cmplx.NaN()  fmt.Println(cmplx.IsNaN(z))}
Go Reference