mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-12-03 16:21:14 +01:00
lib/decimal: calculate ln2/ln10 constant during compile time
This commit is contained in:
parent
8582b50360
commit
5285acae3e
@ -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 New Issue
Block a user