OSDN Git Service

Merge remote-tracking branch 'gnu/gcc-4_7-branch' into rework
[pf3gnuchains/gcc-fork.git] / libgo / go / math / acosh.go
index d8067c0..c6c8645 100644 (file)
@@ -4,7 +4,6 @@
 
 package math
 
-
 // The original C code, the long comment, and the constants
 // below are from FreeBSD's /usr/src/lib/msun/src/e_acosh.c
 // and came with this notice.  The go code is a simplified
@@ -37,6 +36,7 @@ package math
 // Acosh(x) calculates the inverse hyperbolic cosine of x.
 //
 // Special cases are:
+//     Acosh(+Inf) = +Inf
 //     Acosh(x) = NaN if x < 1
 //     Acosh(NaN) = NaN
 func Acosh(x float64) float64 {
@@ -44,11 +44,9 @@ func Acosh(x float64) float64 {
                Ln2   = 6.93147180559945286227e-01 // 0x3FE62E42FEFA39EF
                Large = 1 << 28                    // 2**28
        )
-       // TODO(rsc): Remove manual inlining of IsNaN
-       // when compiler does it for us
        // first case is special case
        switch {
-       case x < 1 || x != x: // x < 1 || IsNaN(x):
+       case x < 1 || IsNaN(x):
                return NaN()
        case x == 1:
                return 0