mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-11-21 14:44:00 +00:00
lib/decimal: calculate ln2/ln10 constant during compile time
This commit is contained in:
parent
8582b50360
commit
5285acae3e
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