this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

pkg/math: reuse Ln2 and Ln10 in Log2E and Log10E

Upstream Go's math package has always used these simple divisions,
and now that pkg/gen.go can resolve complex expressions via go/types,
we can use exactly the same expression in our package.

This change is a no-op, which is guaranteed by Example_constants.
The new code is a lot less verbose and easier to understand, too.

Signed-off-by: Daniel Martí <mvdan@mvdan.cc>
Change-Id: I93dbeb26d3b496c724d53c95afad01f8583e56e0
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/557323
TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>
Reviewed-by: Roger Peppe <rogpeppe@gmail.com>

+2 -2
+2 -2
pkg/math/math.go
··· 151 151 SqrtPhi = 1.27201964951406896425242246173749149171560804184009624861664038 // https://oeis.org/A139339 152 152 153 153 Ln2 = 0.693147180559945309417232121458176568075500134360255254120680009 // https://oeis.org/A002162 154 - Log2E = 1000000000000000000000000000000000000000000000000000000000000000.0 / 693147180559945309417232121458176568075500134360255254120680009 154 + Log2E = 1 / Ln2 155 155 Ln10 = 2.30258509299404568401799145468436420760110148862877297603332790 // https://oeis.org/A002392 156 - Log10E = 10000000000000000000000000000000000000000000000000000000000000.0 / 23025850929940456840179914546843642076011014886287729760333279 156 + Log10E = 1 / Ln10 157 157 ) 158 158 159 159 // Copysign returns a value with the magnitude