summaryrefslogtreecommitdiff
path: root/src/lib/math/log.go
diff options
context:
space:
mode:
authorKen Thompson <ken@golang.org>2008-07-08 20:48:41 -0700
committerKen Thompson <ken@golang.org>2008-07-08 20:48:41 -0700
commit7a74340f6c31db36b4f04b71407db9a137c1f36e (patch)
treea6d555256fd9b1fbdef9694f105c42754241d004 /src/lib/math/log.go
parent6f5a0bd20bc136f6306b4ebb07efe63345311e6d (diff)
downloadgolang-7a74340f6c31db36b4f04b71407db9a137c1f36e.tar.gz
converted double to float64
SVN=126446
Diffstat (limited to 'src/lib/math/log.go')
-rw-r--r--src/lib/math/log.go22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/lib/math/log.go b/src/lib/math/log.go
index 96b3d9695..927a7acdf 100644
--- a/src/lib/math/log.go
+++ b/src/lib/math/log.go
@@ -7,13 +7,13 @@ package math
export log, log10
/*
- log returns the natural logarithm of its floating
- point argument.
-
- The coefficients are #2705 from Hart & Cheney. (19.38D)
-
- It calls frexp.
-*/
+ * log returns the natural logarithm of its floating
+ * point argument.
+ *
+ * The coefficients are #2705 from Hart & Cheney. (19.38D)
+ *
+ * It calls frexp.
+ */
const
(
@@ -30,9 +30,9 @@ const
)
func
-log(arg double) double
+log(arg float64) float64
{
- var x, z, zsq, temp double;
+ var x, z, zsq, temp float64;
var exp int;
if arg <= 0 {
@@ -54,12 +54,12 @@ log(arg double) double
temp = ((p3*zsq + p2)*zsq + p1)*zsq + p0;
temp = temp/(((zsq + q2)*zsq + q1)*zsq + q0);
- temp = temp*z + double(exp)*log2;
+ temp = temp*z + float64(exp)*log2;
return temp;
}
func
-log10(arg double) double
+log10(arg float64) float64
{
if arg <= 0 {