tools

package
v1.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 13, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CompAbs

func CompAbs(a, b int) int

比较绝对值大小

func EqualsArray

func EqualsArray(a, b interface{}) bool

func EqualsArrayStrict

func EqualsArrayStrict(a, b interface{}) bool

func EqualsMatrix

func EqualsMatrix(a, b interface{}) bool

func EqualsMatrixStrict

func EqualsMatrixStrict(a, b interface{}) bool

func GetAbs

func GetAbs(a, b int) (absA, absB int)

获取绝对值

func IntArray2InterfaceArray

func IntArray2InterfaceArray(array []int) ([]interface{}, error)

func Interface2Int

func Interface2Int(v interface{}) (int, error)

*

  • @author ljfirst
  • @version V1.0
  • @date 2023/7/8 01:40
  • @author-Email ljfirst@mail.ustc.edu.cn
  • @blogURL https://blog.csdn.net/ljfirst
  • @description *

func Interface2IntArray

func Interface2IntArray(v interface{}) ([]int, error)

func InterfaceArray2IntArray

func InterfaceArray2IntArray(v []interface{}) ([]int, error)

func Max

func Max(value ...int) int

获取最大值

func MaxIndexInArray

func MaxIndexInArray(array []int, index1, index2 int) int

获取数组中比较的两个数中较大数的下标,出现数组越界的情况返回-1

func Min

func Min(value1, value2 int) int

获取最小值

func MinIndexInArray

func MinIndexInArray(array []int, index1, index2 int) int

获取数组中比较的两个数中较小数的下标,出现数组越界的情况返回-1

func PrintIntArray

func PrintIntArray([]int)

func PrintIntMatrix

func PrintIntMatrix([][]int)

func PrintStruct

func PrintStruct(obj interface{})

func Round

func Round(num float64) float64

获取数字的四舍五入值

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL