1 // Copyright 2010 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
5 // Copyright ©2017 The Gonum Authors. All rights reserved.
6 // Use of this source code is governed by a BSD-style
7 // license that can be found in the LICENSE file.
11 import math "gonum.org/v1/gonum/internal/math32"
13 // IsNaN returns true if either real(x) or imag(x) is NaN
14 // and neither is an infinity.
15 func IsNaN(x complex64) bool {
17 case math.IsInf(real(x), 0) || math.IsInf(imag(x), 0):
19 case math.IsNaN(real(x)) || math.IsNaN(imag(x)):
25 // NaN returns a complex ``not-a-number'' value.
26 func NaN() complex64 {
28 return complex(nan, nan)