We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6ea7bc3 commit ae07ac9Copy full SHA for ae07ac9
pkg/kv/kvserver/asim/history/thrashing_test.go
@@ -8,7 +8,6 @@ package history
8
import (
9
"fmt"
10
"math"
11
- "strconv"
12
"strings"
13
"testing"
14
"testing/quick"
@@ -23,14 +22,9 @@ import (
23
22
)
24
25
func tsFromFunc(ticks int, f func(tick int) float64) []float64 {
26
- roundToSixDigits := func(num float64) float64 {
27
- formatted := fmt.Sprintf("%.6f", num)
28
- result, _ := strconv.ParseFloat(formatted, 64)
29
- return result
30
- }
31
vs := make([]float64, ticks)
32
for i := 0; i < ticks; i++ {
33
- vs[i] = roundToSixDigits(f(i))
+ vs[i] = math.Round(f(i)*1e6) / 1e6
34
}
35
return vs
36
0 commit comments