numi

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2021 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Contains

func Contains(slice []int, s int) bool

Contains Check if the input slice contains given integer

func Delta

func Delta(ints []int) []int

Delta returns the delta between all consecutive ints

func FindIndex

func FindIndex(slice []int, val int) (int, bool)

FindIndex finds the index of first occurrence of the given value

func FindMissingIndexes

func FindMissingIndexes(newslice []int, master []int) (idx []int)

FindMissingIndexes compares <newslice> against <master>. Those numbers' indexes from <master> are collected whic are not found from <newslice>

func Max

func Max(a int, b int) int

Max returns bigger int from two ints

func Min

func Min(a int, b int) int

Min returns smaller int from two ints

func RandRange

func RandRange(min int, max int) int

func SetDefault

func SetDefault(defaultval int, confval int) int

SetDefault set default value for a parameter, if the configuration value is zero (=initialized empty variable)

func Unique

func Unique(t []int) []int

Unique returns unique ints from given slice of ints

Types

This section is empty.

Jump to

Keyboard shortcuts

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