File tree Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ func main() {
30
30
mean = mean + x
31
31
}
32
32
mean = mean / float64 (len (data ))
33
- fmt .Printf ("Average : %.3f\n " , mean )
33
+ fmt .Printf ("Mean : %.3f\n " , mean )
34
34
35
35
var max float64
36
36
for _ , x := range data {
@@ -51,7 +51,7 @@ func main() {
51
51
52
52
var hist = map [float64 ]int {}
53
53
for _ , x := range data {
54
- hist [x ] += 1
54
+ hist [x ]++
55
55
}
56
56
var key float64
57
57
var val int
Original file line number Diff line number Diff line change @@ -17,17 +17,17 @@ func TestMode(t *testing.T) {
17
17
func TestMedian (t * testing.T ) {
18
18
}
19
19
20
- func BenchmarkMean (t * testing.T ) {
20
+ func BenchmarkMean (b * testing.B ) {
21
21
}
22
22
23
- func BenchmarkMax (t * testing.T ) {
23
+ func BenchmarkMax (b * testing.B ) {
24
24
}
25
25
26
- func BenchmarkMin (t * testing.T ) {
26
+ func BenchmarkMin (b * testing.B ) {
27
27
}
28
28
29
- func BenchmarkMode (t * testing.T ) {
29
+ func BenchmarkMode (b * testing.B ) {
30
30
}
31
31
32
- func BenchmarkMedian (t * testing.T ) {
32
+ func BenchmarkMedian (b * testing.B ) {
33
33
}
You can’t perform that action at this time.
0 commit comments