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

Subversion Repositories openrisc

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

Go to most recent revision | 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
// IsNaN returns true if either real(x) or imag(x) is NaN
10
// and neither is an infinity.
11
func IsNaN(x complex128) bool {
12
        switch {
13
        case math.IsInf(real(x), 0) || math.IsInf(imag(x), 0):
14
                return false
15
        case math.IsNaN(real(x)) || math.IsNaN(imag(x)):
16
                return true
17
        }
18
        return false
19
}
20
 
21
// NaN returns a complex ``not-a-number'' value.
22
func NaN() complex128 {
23
        nan := math.NaN()
24
        return complex(nan, nan)
25
}

powered by: WebSVN 2.1.0

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