diff options
author | Ken Thompson <ken@golang.org> | 2008-07-08 20:48:41 -0700 |
---|---|---|
committer | Ken Thompson <ken@golang.org> | 2008-07-08 20:48:41 -0700 |
commit | 7a74340f6c31db36b4f04b71407db9a137c1f36e (patch) | |
tree | a6d555256fd9b1fbdef9694f105c42754241d004 /src/lib/math/exp.go | |
parent | 6f5a0bd20bc136f6306b4ebb07efe63345311e6d (diff) | |
download | golang-7a74340f6c31db36b4f04b71407db9a137c1f36e.tar.gz |
converted double to float64
SVN=126446
Diffstat (limited to 'src/lib/math/exp.go')
-rw-r--r-- | src/lib/math/exp.go | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/lib/math/exp.go b/src/lib/math/exp.go index dc851a084..cce9386b7 100644 --- a/src/lib/math/exp.go +++ b/src/lib/math/exp.go @@ -8,11 +8,11 @@ import math "floor" export exp /* - exp returns the exponential func of its - floating-point argument. - - The coefficients are #1069 from Hart and Cheney. (22.35D) -*/ + * exp returns the exponential func of its + * floating-point argument. + * + * The coefficients are #1069 from Hart and Cheney. (22.35D) + */ const ( @@ -28,16 +28,16 @@ const ) func -exp(arg double) double +exp(arg float64) float64 { - var x, fract, temp1, temp2, xsq double; + var x, fract, temp1, temp2, xsq float64; var ent int; if arg == 0. { return 1; } if arg < -maxf { - return 0.; + return 0; } if arg > maxf { return sys.Inf(1) @@ -45,7 +45,7 @@ exp(arg double) double x = arg*log2e; ent = int(floor(x)); - fract = (x-double(ent)) - 0.5; + fract = (x-float64(ent)) - 0.5; xsq = fract*fract; temp1 = ((p2*xsq+p1)*xsq+p0)*fract; temp2 = ((xsq+q2)*xsq+q1)*xsq + q0; |