gitee.com/quant1x/num@v0.3.2/cumsum_test.go (about) 1 package num 2 3 import ( 4 "fmt" 5 "testing" 6 ) 7 8 func TestCumSum(t *testing.T) { 9 n1 := []float32{1.1, 2.2, 1.3, 1.4} 10 n2 := []float64{1.2, 1.2, 3.3} 11 n3 := []int8{1, 2, 3} 12 fmt.Println(CumSum(n1)) 13 fmt.Println(CumSum(n2)) 14 fmt.Println(CumSum(n3)) 15 }