summaryrefslogtreecommitdiff
path: root/libgo/go/math/dim.go
diff options
context:
space:
mode:
Diffstat (limited to 'libgo/go/math/dim.go')
-rw-r--r--libgo/go/math/dim.go12
1 files changed, 4 insertions, 8 deletions
diff --git a/libgo/go/math/dim.go b/libgo/go/math/dim.go
index 24a84e6d03b..37ab5388073 100644
--- a/libgo/go/math/dim.go
+++ b/libgo/go/math/dim.go
@@ -30,13 +30,11 @@ func Max(x, y float64) float64 {
}
func max(x, y float64) float64 {
- // TODO(rsc): Remove manual inlining of IsNaN, IsInf
- // when compiler does it for us
// special cases
switch {
- case x > MaxFloat64 || y > MaxFloat64: // IsInf(x, 1) || IsInf(y, 1):
+ case IsInf(x, 1) || IsInf(y, 1):
return Inf(1)
- case x != x || y != y: // IsNaN(x) || IsNaN(y):
+ case IsNaN(x) || IsNaN(y):
return NaN()
case x == 0 && x == y:
if Signbit(x) {
@@ -61,13 +59,11 @@ func Min(x, y float64) float64 {
}
func min(x, y float64) float64 {
- // TODO(rsc): Remove manual inlining of IsNaN, IsInf
- // when compiler does it for us
// special cases
switch {
- case x < -MaxFloat64 || y < -MaxFloat64: // IsInf(x, -1) || IsInf(y, -1):
+ case IsInf(x, -1) || IsInf(y, -1):
return Inf(-1)
- case x != x || y != y: // IsNaN(x) || IsNaN(y):
+ case IsNaN(x) || IsNaN(y):
return NaN()
case x == 0 && x == y:
if Signbit(x) {