Rebase.
[official-gcc.git] / libgo / go / math / cmplx / isinf.go
blobd5a65b44b320c80da1500a4444907d4e2521c5a1
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 package cmplx
7 import "math"
9 // IsInf returns true if either real(x) or imag(x) is an infinity.
10 func IsInf(x complex128) bool {
11 if math.IsInf(real(x), 0) || math.IsInf(imag(x), 0) {
12 return true
14 return false
17 // Inf returns a complex infinity, complex(+Inf, +Inf).
18 func Inf() complex128 {
19 inf := math.Inf(1)
20 return complex(inf, inf)