OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [libgo/] [go/] [math/] [cmplx/] [isinf.go] - Blame information for rev 747

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 747 jeremybenn
// 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.
4
 
5
package cmplx
6
 
7
import "math"
8
 
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
13
        }
14
        return false
15
}
16
 
17
// Inf returns a complex infinity, complex(+Inf, +Inf).
18
func Inf() complex128 {
19
        inf := math.Inf(1)
20
        return complex(inf, inf)
21
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.