summaryrefslogtreecommitdiff
path: root/src/pkg/math/log10.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/pkg/math/log10.go')
-rw-r--r--src/pkg/math/log10.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/pkg/math/log10.go b/src/pkg/math/log10.go
index 67c163a49..95cfbf47c 100644
--- a/src/pkg/math/log10.go
+++ b/src/pkg/math/log10.go
@@ -17,5 +17,6 @@ func log10(x float64) float64 {
func Log2(x float64) float64
func log2(x float64) float64 {
- return Log(x) * (1 / Ln2)
+ frac, exp := Frexp(x)
+ return Log(frac)*(1/Ln2) + float64(exp)
}