numutil

package
v0.0.0-...-9c21ab8 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2021 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func C

func C(n, k int) int

计算组合结果

func Combinations

func Combinations(arr []int, m int) [][]int

从数组中选出m个任意组合 算法:先固定某一位的数字,再遍历其他位的可能性,递归此过程

func CombinationsInt32

func CombinationsInt32(arr []int32, m int) [][]int32

从数组中选出m个任意组合,Int32版 算法:先固定某一位的数字,再遍历其他位的可能性,递归此过程

func ConvertToFloat64

func ConvertToFloat64(unk interface{}) (float64, error)

ConvertToFloat64 guess Num format and convert to Float64

func ConvertToInt

func ConvertToInt(temp interface{}) (int, error)

ConvertToInt guess Num format and convert to Int

func DirectProduct

func DirectProduct(items ...[]int) [][]int

任意多个集合的笛卡尔积(直积) 回溯法遍历所有可能性

func DirectProductInt32

func DirectProductInt32(items ...[]int32) [][]int32

任意多个集合的笛卡尔积(直积),Int32版 回溯法遍历所有可能性

func MaxInt

func MaxInt(x, y int) int

func MaxInt32

func MaxInt32(x, y int32) int32

func MaxInt64

func MaxInt64(x, y int64) int64

func MinInt

func MinInt(x, y int) int

func MinInt32

func MinInt32(x, y int32) int32

func MinInt64

func MinInt64(x, y int64) int64

func Permutations

func Permutations(arr []int) [][]int

全排列

func Range

func Range(start, end int) []int

生成一个从start到end-1的数组

func RangeInt32

func RangeInt32(start, end int32) []int32

生成一个从start到end-1的数组

Types

This section is empty.

Jump to

Keyboard shortcuts

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