diff options
Diffstat (limited to 'libgo/go/math/sin.go')
-rw-r--r-- | libgo/go/math/sin.go | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/libgo/go/math/sin.go b/libgo/go/math/sin.go index d692b33..13fe408 100644 --- a/libgo/go/math/sin.go +++ b/libgo/go/math/sin.go @@ -129,11 +129,9 @@ func cos(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 != x || x < -MaxFloat64 || x > MaxFloat64: // IsNaN(x) || IsInf(x, 0): + case IsNaN(x) || IsInf(x, 0): return NaN() } @@ -194,13 +192,11 @@ func sin(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() } |