Standard library / math/cmplx

cmplx.IsNaN()

True if either component is NaN and neither component is infinite. Expected stdout: 'true\n'.

Formal Syntax & Structure

go syntaxgo
func IsNaN(x complex128) bool

Parameters & Attributes

NameTypeDescription
xcomplex128First input operand (or sole input if unary).

Return Value

bool

True if either component is NaN and neither component is infinite.

Working Example

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