summaryrefslogtreecommitdiff
path: root/src/pkg/math/expm1.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/pkg/math/expm1.go')
-rw-r--r--src/pkg/math/expm1.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/pkg/math/expm1.go b/src/pkg/math/expm1.go
index e9f833140..8f56e15cc 100644
--- a/src/pkg/math/expm1.go
+++ b/src/pkg/math/expm1.go
@@ -121,7 +121,9 @@ package math
// Expm1(-Inf) = -1
// Expm1(NaN) = NaN
// Very large values overflow to -1 or +Inf.
-func Expm1(x float64) float64 {
+func Expm1(x float64) float64
+
+func expm1(x float64) float64 {
const (
Othreshold = 7.09782712893383973096e+02 // 0x40862E42FEFA39EF
Ln2X56 = 3.88162421113569373274e+01 // 0x4043687a9f1af2b1
@@ -140,12 +142,10 @@ func Expm1(x float64) float64 {
)
// special cases
- // TODO(rsc): Remove manual inlining of IsNaN, IsInf
- // when compiler does it for us
switch {
- case x > MaxFloat64 || x != x: // IsInf(x, 1) || IsNaN(x):
+ case IsInf(x, 1) || IsNaN(x):
return x
- case x < -MaxFloat64: // IsInf(x, -1):
+ case IsInf(x, -1):
return -1
}