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

     1  package num
     2  
     3  import (
     4  	"fmt"
     5  	"testing"
     6  )
     7  
     8  func Test_integer2Bool(t *testing.T) {
     9  	fmt.Println(integer2Bool(int(0)))
    10  	fmt.Println(integer2Bool(int(1)))
    11  	fmt.Println(integer2Bool(int64(0)))
    12  	fmt.Println(integer2Bool(int64(1)))
    13  	fmt.Println(integer2Bool(float32(0)))
    14  	fmt.Println(integer2Bool(float32(1)))
    15  	fmt.Println(integer2Bool(float64(0)))
    16  	fmt.Println(integer2Bool(float64(1)))
    17  }