summaryrefslogtreecommitdiffstats
path: root/libgo/go/math/erf.go
diff options
context:
space:
mode:
Diffstat (limited to 'libgo/go/math/erf.go')
-rw-r--r--libgo/go/math/erf.go16
1 files changed, 6 insertions, 10 deletions
diff --git a/libgo/go/math/erf.go b/libgo/go/math/erf.go
index 6d3d9b7c537..87c70c2512f 100644
--- a/libgo/go/math/erf.go
+++ b/libgo/go/math/erf.go
@@ -191,14 +191,12 @@ func Erf(x float64) float64 {
Small = 1.0 / (1 << 28) // 2**-28
)
// special cases
- // TODO(rsc): Remove manual inlining of IsNaN, IsInf
- // when compiler does it for us
switch {
- case x != x: // IsNaN(x):
+ case IsNaN(x):
return NaN()
- case x > MaxFloat64: // IsInf(x, 1):
+ case IsInf(x, 1):
return 1
- case x < -MaxFloat64: // IsInf(x, -1):
+ case IsInf(x, -1):
return -1
}
sign := false
@@ -267,14 +265,12 @@ func Erf(x float64) float64 {
func Erfc(x float64) float64 {
const Tiny = 1.0 / (1 << 56) // 2**-56
// special cases
- // TODO(rsc): Remove manual inlining of IsNaN, IsInf
- // when compiler does it for us
switch {
- case x != x: // IsNaN(x):
+ case IsNaN(x):
return NaN()
- case x > MaxFloat64: // IsInf(x, 1):
+ case IsInf(x, 1):
return 0
- case x < -MaxFloat64: // IsInf(x, -1):
+ case IsInf(x, -1):
return 2
}
sign := false
OpenPOWER on IntegriCloud