From 29760f278cf9110e9e165af3f8aa53a89ff94f86 Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Thu, 22 Jan 2009 16:23:44 -0800 Subject: 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 --- src/lib/math/exp.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/lib/math/exp.go') 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); } -- cgit v1.2.3