summaryrefslogtreecommitdiff
path: root/libgo/go/math/remainder.go
diff options
context:
space:
mode:
Diffstat (limited to 'libgo/go/math/remainder.go')
-rw-r--r--libgo/go/math/remainder.go10
1 files changed, 7 insertions, 3 deletions
diff --git a/libgo/go/math/remainder.go b/libgo/go/math/remainder.go
index 7fb8a12f9e6..77811b183f5 100644
--- a/libgo/go/math/remainder.go
+++ b/libgo/go/math/remainder.go
@@ -29,12 +29,16 @@ package math
// Remainder returns the IEEE 754 floating-point remainder of x/y.
//
// Special cases are:
-// Remainder(x, NaN) = NaN
+// Remainder(±Inf, y) = NaN
// Remainder(NaN, y) = NaN
-// Remainder(Inf, y) = NaN
// Remainder(x, 0) = NaN
-// Remainder(x, Inf) = x
+// Remainder(x, ±Inf) = x
+// Remainder(x, NaN) = NaN
func Remainder(x, y float64) float64 {
+ return remainder(x, y)
+}
+
+func remainder(x, y float64) float64 {
const (
Tiny = 4.45014771701440276618e-308 // 0x0020000000000000
HalfMax = MaxFloat64 / 2