ints

package
v0.0.0-...-77dcbbd Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2024 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package ints provides utility functions for int slices.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Include

func Include[T Integer](list []T, target T) bool

Include returns true if the list contains target integer.

func IsUnique

func IsUnique[T Integer](list []T) bool

Unique takes integer slice and return true if it contains unique set.

func Max

func Max[T Integer](nums ...T) T

MaxUInt32 returns max number within input (input order will be mutated).

func Min

func Min[T Integer](nums ...T) T

MaxUInt32 returns max number within input (input order will be mutated).

func Unique

func Unique[T Integer](list []T) []T

Unique takes integer slice and return unique set of integer.

Types

type Integer

type Integer interface {
	~int | ~uint | ~int8 | ~uint8 | ~int16 | ~uint16 | ~int32 | ~uint32 | ~int64 | ~uint64
}

Integer is type for generic for any integers.

Jump to

Keyboard shortcuts

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