diff options
Diffstat (limited to 'libgo/go/math/exp.go')
-rw-r--r-- | libgo/go/math/exp.go | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/libgo/go/math/exp.go b/libgo/go/math/exp.go index b2da631c697..51330c21dc8 100644 --- a/libgo/go/math/exp.go +++ b/libgo/go/math/exp.go @@ -106,13 +106,11 @@ func exp(x float64) float64 { NearZero = 1.0 / (1 << 28) // 2**-28 ) - // TODO(rsc): Remove manual inlining of IsNaN, IsInf - // when compiler does it for us // special cases switch { - case x != x || x > MaxFloat64: // IsNaN(x) || IsInf(x, 1): + case IsNaN(x) || IsInf(x, 1): return x - case x < -MaxFloat64: // IsInf(x, -1): + case IsInf(x, -1): return 0 case x > Overflow: return Inf(1) @@ -153,13 +151,11 @@ func exp2(x float64) float64 { Underflow = -1.0740e+03 ) - // TODO: remove manual inlining of IsNaN and IsInf - // when compiler does it for us // special cases switch { - case x != x || x > MaxFloat64: // IsNaN(x) || IsInf(x, 1): + case IsNaN(x) || IsInf(x, 1): return x - case x < -MaxFloat64: // IsInf(x, -1): + case IsInf(x, -1): return 0 case x > Overflow: return Inf(1) |