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

     1  package num
     2  
     3  import (
     4  	"fmt"
     5  	"testing"
     6  )
     7  
     8  func Test_calculate2(t *testing.T) {
     9  	f1 := []float32{1, 2, 3, 4, 5, 6, 7, 8, 9, 10}
    10  	f2 := []float32{1, 2, 3, 4, 5, 6, 7, 8, 9, 10}
    11  	d2 := []float64{1, 2, 3, 4, 5, 6, 7, 8, 9, 10}
    12  	d3 := []int32{1, 2, 3, 4, 5, 6, 7, 8, 9, 10}
    13  	d4 := []int64{1, 2, 3, 4, 5, 6, 7, 8, 9, 10}
    14  	fmt.Println(Sub(f1, f2))
    15  	fmt.Println(Sub(d2, float64(1)))
    16  	fmt.Println(Sub(d3, int32(2)))
    17  	fmt.Println(Sub(d4, int64(3)))
    18  }