gitee.com/quant1x/num@v0.3.2/sum_test.go (about) 1 package num 2 3 import ( 4 "fmt" 5 "testing" 6 ) 7 8 func TestSum(t *testing.T) { 9 d1 := []float32{1, 2, 3, 4, 5, 6, 7, 8, 9, 10} 10 d2 := []float64{1, 2, 3, 4, 5, 6, 7, 8, 9, 10} 11 d3 := []int32{1, 2, 3, 4, 5, 6, 7, 8, 9, 10} 12 d4 := []int64{1, 2, 3, 4, 5, 6, 7, 8, 9, 10} 13 fmt.Println(Sum(d1)) 14 fmt.Println(Sum(d2)) 15 fmt.Println(Sum(d3)) 16 fmt.Println(Sum(d4)) 17 }