]> Cypherpunks repositories - gostls13.git/commit
math: handle exponent separately in Log2
authorRuss Cox <rsc@golang.org>
Thu, 20 Dec 2012 17:23:27 +0000 (12:23 -0500)
committerRuss Cox <rsc@golang.org>
Thu, 20 Dec 2012 17:23:27 +0000 (12:23 -0500)
commita3677b5f223db6ccadf26f81a751c4f8c8c0eaf9
treed8654b55a7b14095d983cf308ebe1d2eb2d91433
parent708db79011010549827fb18c800489a20a04b47c
math: handle exponent separately in Log2

This guarantees that powers of two return exact answers.

We could do a multiprecision approximation for the
rest of the answer too, but this seems like it should be
good enough.

Fixes #4567.

R=golang-dev, iant, remyoudompheng
CC=golang-dev
https://golang.org/cl/6943074
src/pkg/math/all_test.go
src/pkg/math/log10.go