diff options
| author | Ondřej Surý <ondrej@sury.org> | 2012-04-06 15:14:11 +0200 |
|---|---|---|
| committer | Ondřej Surý <ondrej@sury.org> | 2012-04-06 15:14:11 +0200 |
| commit | 505c19580e0f43fe5224431459cacb7c21edd93d (patch) | |
| tree | 79e2634c253d60afc0cc0b2f510dc7dcbb48497b /src/pkg/math/log.go | |
| parent | 1336a7c91e596c423a49d1194ea42d98bca0d958 (diff) | |
| download | golang-505c19580e0f43fe5224431459cacb7c21edd93d.tar.gz | |
Imported Upstream version 1upstream/1
Diffstat (limited to 'src/pkg/math/log.go')
| -rw-r--r-- | src/pkg/math/log.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/pkg/math/log.go b/src/pkg/math/log.go index a786c8ce3..818f00a73 100644 --- a/src/pkg/math/log.go +++ b/src/pkg/math/log.go @@ -77,7 +77,9 @@ package math // Log(0) = -Inf // Log(x < 0) = NaN // Log(NaN) = NaN -func Log(x float64) float64 { +func Log(x float64) float64 + +func log(x float64) float64 { const ( Ln2Hi = 6.93147180369123816490e-01 /* 3fe62e42 fee00000 */ Ln2Lo = 1.90821492927058770002e-10 /* 3dea39ef 35793c76 */ @@ -90,11 +92,9 @@ func Log(x float64) float64 { L7 = 1.479819860511658591e-01 /* 3FC2F112 DF3E5244 */ ) - // TODO(rsc): Remove manual inlining of IsNaN, IsInf - // when compiler does it for us // special cases switch { - case x != x || x > MaxFloat64: // IsNaN(x) || IsInf(x, 1): + case IsNaN(x) || IsInf(x, 1): return x case x < 0: return NaN() |
