gitee.com/quant1x/num@v0.3.2/mean_test.go (about)

     1  package num
     2  
     3  import (
     4  	"fmt"
     5  	"testing"
     6  )
     7  
     8  func TestMean(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(Mean(d1))
    14  	fmt.Println(Mean(d2))
    15  	fmt.Println(Mean(d3))
    16  	fmt.Println(Mean(d4))
    17  }