fix for #18284 int32 should be int (#18285)

the var exp was typed as int32 - it should be int since frep expects an int
This commit is contained in:
Adrian Veith 2021-06-17 11:23:38 +02:00 • committed by GitHub
commit 5a3456d220
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -997,7 +997,7 @@ when not defined(js):
# taken from Go-lang Math.Log2 # taken from Go-lang Math.Log2
const ln2 = 0.693147180559945309417232121458176568075500134360255254120680009 const ln2 = 0.693147180559945309417232121458176568075500134360255254120680009
template log2Impl[T](x: T): T = template log2Impl[T](x: T): T =
var exp: int32 var exp: int
var frac = frexp(x, exp) var frac = frexp(x, exp)
# Make sure exact powers of two give an exact answer. # Make sure exact powers of two give an exact answer.
# Don't depend on Log(0.5)*(1/Ln2)+exp being exactly exp-1. # Don't depend on Log(0.5)*(1/Ln2)+exp being exactly exp-1.