mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2025-01-20 15:16:42 +00:00
lib/decimal: calculate ln2/ln10 constant during compile time
This commit is contained in:
parent
414259f47b
commit
d24fc87a6f
1 changed files with 1 additions and 1 deletions
|
@ -358,7 +358,7 @@ func positiveFloatToDecimalSlow(f float64) (int64, int16) {
|
|||
prec = 1e15
|
||||
}
|
||||
_, exp := math.Frexp(f)
|
||||
scale = int16(float64(exp) * math.Ln2 / math.Ln10)
|
||||
scale = int16(float64(exp) * (math.Ln2 / math.Ln10))
|
||||
f *= math.Pow10(-int(scale))
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue