diff options
Diffstat (limited to 'src/lib/math/fmod.go')
-rw-r--r-- | src/lib/math/fmod.go | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/lib/math/fmod.go b/src/lib/math/fmod.go index f30ae3563..75e5eece2 100644 --- a/src/lib/math/fmod.go +++ b/src/lib/math/fmod.go @@ -4,6 +4,8 @@ package math +import "math" + /* * floating-point mod func without infinity or NaN checking */ @@ -16,7 +18,7 @@ func Fmod(x, y float64) float64 { y = -y; } - yfr, yexp := sys.Frexp(y); + yfr, yexp := Frexp(y); sign := false; r := x; if x < 0 { @@ -25,11 +27,11 @@ func Fmod(x, y float64) float64 { } for r >= y { - rfr, rexp := sys.Frexp(r); + rfr, rexp := Frexp(r); if rfr < yfr { rexp = rexp - 1; } - r = r - sys.Ldexp(y, rexp-yexp); + r = r - Ldexp(y, rexp-yexp); } if sign { r = -r; |