numi

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 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 checks if given integer exists in the slice

func Cumsum added in v0.2.5

func Cumsum(slice []int) []int

Cumsum calculates cumulative sum slice from given slice

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 which are not found from <newslice>

func Insert added in v0.2.3

func Insert(slice []int, idx int, val int) []int

Insert inserts given value to given index into a slice

func Max

func Max(a int, b int) int

Max returns bigger of ints

func Min

func Min(a int, b int) int

Min returns smaller of ints

func RandRange

func RandRange(min int, max int) int

func Remove added in v0.2.3

func Remove(slice []int, s int) []int

Remove removes given integer from a slice

func RemoveFrom added in v0.2.3

func RemoveFrom(slice []int, s int) []int

RemoveFrom removes an integer from given index

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 SliceOf added in v0.2.5

func SliceOf(value int, size int) []int

SliceOf creates a slice of given <size> filled with <value>

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