diff options
author | Russ Cox <rsc@golang.org> | 2009-01-22 16:23:44 -0800 |
---|---|---|
committer | Russ Cox <rsc@golang.org> | 2009-01-22 16:23:44 -0800 |
commit | 29760f278cf9110e9e165af3f8aa53a89ff94f86 (patch) | |
tree | ece2442553c8681e8134d2201e6201e1e429adb8 /src/lib/math/exp.go | |
parent | ca01b9bdc8fc325f98c57b1949942edfc00867f7 (diff) | |
download | golang-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/exp.go')
-rw-r--r-- | src/lib/math/exp.go | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/lib/math/exp.go b/src/lib/math/exp.go index 0d06ff9cb..d781c1dec 100644 --- a/src/lib/math/exp.go +++ b/src/lib/math/exp.go @@ -101,12 +101,12 @@ func Exp(x float64) float64 { // special cases switch { - case sys.IsNaN(x) || sys.IsInf(x, 1): + case IsNaN(x) || IsInf(x, 1): return x; - case sys.IsInf(x, -1): + case IsInf(x, -1): return 0; case x > Overflow: - return sys.Inf(1); + return Inf(1); case x < Underflow: return 0; case -NearZero < x && x < NearZero: @@ -129,6 +129,6 @@ func Exp(x float64) float64 { t := r * r; c := r - t*(P1+t*(P2+t*(P3+t*(P4+t*P5)))); y := 1 - ((lo - (r*c)/(2-c)) - hi); - // TODO(rsc): make sure sys.Ldexp can handle boundary k - return sys.Ldexp(y, k); + // TODO(rsc): make sure Ldexp can handle boundary k + return Ldexp(y, k); } |