summaryrefslogtreecommitdiff
path: root/src/pkg/math/tan.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/pkg/math/tan.go')
-rw-r--r--src/pkg/math/tan.go6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/pkg/math/tan.go b/src/pkg/math/tan.go
index 4e722e1ad..b2f29cc3b 100644
--- a/src/pkg/math/tan.go
+++ b/src/pkg/math/tan.go
@@ -88,13 +88,11 @@ func tan(x float64) float64 {
PI4C = 2.69515142907905952645E-15 // 0x3ce8469898cc5170,
M4PI = 1.273239544735162542821171882678754627704620361328125 // 4/pi
)
- // TODO(rsc): Remove manual inlining of IsNaN, IsInf
- // when compiler does it for us
// special cases
switch {
- case x == 0 || x != x: // x == 0 || IsNaN():
+ case x == 0 || IsNaN(x):
return x // return ±0 || NaN()
- case x < -MaxFloat64 || x > MaxFloat64: // IsInf(x, 0):
+ case IsInf(x, 0):
return NaN()
}