int16y

package
v0.0.18 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Abs

func Abs(v int16) int16

Abs returns the absolute value of v.

func Contains

func Contains(vs []int16, v int16) bool

Contains returns true if vs contains v.

func FromString

func FromString(s string) (int16, error)

FromString parses s and returns a int16.

func Int16

func Int16(v *int16) int16

Int16 dereferences and returns int16. The int16 default value is returned if v is nil.

func Int16OrDefault

func Int16OrDefault(v *int16, defaultVal int16) *int16

Int16OrDefault returns int16 if it is not nil, and a pointer to defaultVal otherwise.

func Max

func Max(v int16, vs ...int16) int16

Max returns the maximum value from v and vs.

func Min

func Min(v int16, vs ...int16) int16

Min returns the minimum value from v and vs.

func Pointer

func Pointer(v int16) *int16

Pointer returns a pointer to the given int16.

func Random

func Random() int16

Random returns a non-negative pseudo-random number of type int16

func RandomN

func RandomN(n int16) int16

RandomN returns a non-negative pseudo-random number in [0,n) of type int16. It panics if n <= 0.

func Sort

func Sort(vs []int16) []int16

Sort sorts data in place. Not guaranteed to be stable.

func Unique

func Unique(vs []int16) []int16

Unique returns a new list containing unique int16s from the given input

Types

type Int16Slice

type Int16Slice []int16

func (Int16Slice) Len

func (p Int16Slice) Len() int

func (Int16Slice) Less

func (p Int16Slice) Less(i, j int) bool

func (Int16Slice) Swap

func (p Int16Slice) Swap(i, j int)

type Set

type Set map[int16]struct{}

func MakeSet

func MakeSet(vs ...int16) Set

MakeSet returns a lookup map for int16

func ToSet

func ToSet(vs []int16) Set

ToSet returns a lookup map for int16.

func (Set) Contains

func (s Set) Contains(v int16) bool

Contains returns true if Set contains v.

func (Set) Equal

func (s Set) Equal(s2 Set) bool

Equal checks whether all

func (Set) Intersect

func (s Set) Intersect(s2 Set) Set

Intersect returns the intersection of two Sets.

func (Set) Union

func (s Set) Union(s2 Set) Set

Union returns the union of two Sets.

Jump to

Keyboard shortcuts

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