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

     1  package num
     2  
     3  import (
     4  	"fmt"
     5  	"math"
     6  	"testing"
     7  )
     8  
     9  func TestMaxinum(t *testing.T) {
    10  	fmt.Println(1.4 > math.NaN())
    11  	fmt.Println(1.4 < math.NaN())
    12  	f1 := []float32{1.1, 2.2, 1.3, 1.4}
    13  	f2 := []float32{1.2, 1.2, 3.3}
    14  	fmt.Println(Maximum(f1, f2))
    15  	fmt.Println(Maximum([]float64{1}, []float64{1}))
    16  	fmt.Println(Maximum([]int{1}, []int{2}))
    17  	fmt.Println(Maximum([]int{2}, []int{1, 2, 3}))
    18  	fmt.Println(Maximum([]int{1, 2, 3, 4, 5}, []int{2}))
    19  }