summaryrefslogtreecommitdiff
path: root/src/lib/math/pow.go
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2009-01-22 16:23:44 -0800
committerRuss Cox <rsc@golang.org>2009-01-22 16:23:44 -0800
commit29760f278cf9110e9e165af3f8aa53a89ff94f86 (patch)
treeece2442553c8681e8134d2201e6201e1e429adb8 /src/lib/math/pow.go
parentca01b9bdc8fc325f98c57b1949942edfc00867f7 (diff)
downloadgolang-29760f278cf9110e9e165af3f8aa53a89ff94f86.tar.gz
move math routines from package sys to package math,
though they still build in src/runtime. use cgo instead of hand-written wrappers. R=r DELTA=740 (289 added, 300 deleted, 151 changed) OCL=23326 CL=23331
Diffstat (limited to 'src/lib/math/pow.go')
-rw-r--r--src/lib/math/pow.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/lib/math/pow.go b/src/lib/math/pow.go
index 3ab218d5e..929943a13 100644
--- a/src/lib/math/pow.go
+++ b/src/lib/math/pow.go
@@ -17,7 +17,7 @@ func Pow(x, y float64) float64 {
case x == 0 && y > 0:
return 0;
case x == 0 && y < 0:
- return sys.Inf(1);
+ return Inf(1);
case y == 0.5:
return Sqrt(x);
case y == -0.5:
@@ -30,9 +30,9 @@ func Pow(x, y float64) float64 {
absy = -absy;
flip = true;
}
- yi, yf := sys.Modf(absy);
+ yi, yf := Modf(absy);
if yf != 0 && x < 0 {
- return sys.NaN();
+ return NaN();
}
if yi >= 1<<63 {
return Exp(y * Log(x));
@@ -55,7 +55,7 @@ func Pow(x, y float64) float64 {
// by multiplying in successive squarings
// of x according to bits of yi.
// accumulate powers of two into exp.
- x1, xe := sys.Frexp(x);
+ x1, xe := Frexp(x);
for i := int64(yi); i != 0; i >>= 1 {
if i&1 == 1 {
a1 *= x1;
@@ -76,5 +76,5 @@ func Pow(x, y float64) float64 {
a1 = 1 / a1;
ae = -ae;
}
- return sys.Ldexp(a1, ae);
+ return Ldexp(a1, ae);
}