numeric

package
v0.1.10 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppendInt

func AppendInt(s []int, e int) []int

AppendInt append int to slice with no duplicates.

func AppendInt16

func AppendInt16(s []int16, e int16) []int16

AppendInt16 appends int16 to slice with no duplicates.

func AppendInt32

func AppendInt32(s []int32, e int32) []int32

AppendInt32 appends int32 to slice with no duplicates.

func AppendInt64

func AppendInt64(s []int64, e int64) []int64

AppendInt64 appends int64 to slice with no duplicates.

func AppendInt8

func AppendInt8(s []int8, e int8) []int8

AppendInt8 append int8 to slice with no duplicates.

func AppendUint

func AppendUint(s []uint, e uint) []uint

AppendUint append uint to slice with no duplicates.

func AppendUint16

func AppendUint16(s []uint16, e uint16) []uint16

AppendUint16 appends uint16 to slice with no duplicates.

func AppendUint32

func AppendUint32(s []uint32, e uint32) []uint32

AppendUint32 appends uint16 to slice with no duplicates.

func AppendUint64

func AppendUint64(s []uint64, e uint64) []uint64

AppendUint64 appends int64 to slice with no duplicates.

func AppendUint8

func AppendUint8(s []uint8, e uint8) []uint8

AppendUint8 append uint8 to slice with no duplicates.

func BreakUint16

func BreakUint16(v uint16) (loByte, hiByte byte)

BreakUint16 break into bytes

func BreakUint32

func BreakUint32(v uint32) (byte0, byte1, byte2, byte3 byte)

BreakUint32 break into bytes

func BreakUint64

func BreakUint64(v uint64) (lo32, hi32 uint32)

BreakUint64 break into uint32

func BuildUint16

func BuildUint16(loByte, hiByte byte) uint16

BuildUint16 combine into uint16

func BuildUint32

func BuildUint32(byte0, byte1, byte2, byte3 byte) uint32

BuildUint32 combine into uint32

func BuildUint64

func BuildUint64(lo32, hi32 uint32) uint64

BuildUint64 combine into uint64

func Contain

func Contain(vs []interface{}, x interface{}) bool

Contain checks if x exists in a slice and returns TRUE if x is found.

func ContainFloat64

func ContainFloat64(vs []float64, x float64) bool

ContainFloat64 checks if x exists in []float64s and returns TRUE if x is found.

func ContainInt

func ContainInt(vs []int, x int) bool

ContainInt checks if x exists in []ints and returns TRUE if x is found.

func ContainInt16

func ContainInt16(vs []int16, x int16) bool

ContainInt16 checks if x exists in []int16s and returns TRUE if x is found.

func ContainInt32

func ContainInt32(vs []int32, x int32) bool

ContainInt32 checks if x exists in []int32s and returns TRUE if x is found.

func ContainInt64

func ContainInt64(vs []int64, x int64) bool

ContainInt64 checks if x exists in []int64s and returns TRUE if x is found.

func ContainInt8

func ContainInt8(vs []int8, x int8) bool

ContainInt8 checks if x exists in []int8s and returns TRUE if x is found.

func ContainUint

func ContainUint(vs []uint, x uint) bool

ContainUint checks if x exists in []uints and returns TRUE if x is found.

func ContainUint16

func ContainUint16(vs []uint16, x uint16) bool

ContainUint16 checks if x exists in []uint16s and returns TRUE if x is found.

func ContainUint32

func ContainUint32(vs []uint32, x uint32) bool

ContainUint32 checks if x exists in []uint32s and returns TRUE if x is found.

func ContainUint64

func ContainUint64(vs []uint64, x uint64) bool

ContainUint64 checks if x exists in []uint64s and returns TRUE if x is found.

func ContainUint8

func ContainUint8(vs []uint8, x uint8) bool

ContainUint8 checks if x exists in []uint8s and returns TRUE if x is found.

func DeleteInt

func DeleteInt(s []int, e int) []int

DeleteInt delete an int element from slice if it exist

func DeleteInt16

func DeleteInt16(s []int16, e int16) []int16

DeleteInt16 delete an int16 element from slice if it exist

func DeleteInt16All

func DeleteInt16All(s []int16, e int16) []int16

DeleteInt16All delete all int16 element from slice if it exist

func DeleteInt32

func DeleteInt32(s []int32, e int32) []int32

DeleteInt32 delete an int32 element from slice if it exist

func DeleteInt32All

func DeleteInt32All(s []int32, e int32) []int32

DeleteInt32All delete all int32 element from slice if it exist

func DeleteInt64

func DeleteInt64(s []int64, e int64) []int64

DeleteInt64 delete an int64 element from slice if it exist

func DeleteInt64All

func DeleteInt64All(s []int64, e int64) []int64

DeleteInt64All delete all int64 element from slice if it exist

func DeleteInt8

func DeleteInt8(s []int8, e int8) []int8

DeleteInt8 delete an int8 element from slice if it exist

func DeleteInt8All

func DeleteInt8All(s []int8, e int8) []int8

DeleteInt8All delete all int8 element from slice if it exist

func DeleteIntAll

func DeleteIntAll(s []int, e int) []int

DeleteIntAll delete all int element from slice if it exist

func DeleteUint

func DeleteUint(s []uint, e uint) []uint

DeleteUint delete an uint element from slice if it exist

func DeleteUint16

func DeleteUint16(s []uint16, e uint16) []uint16

DeleteUint16 delete an uint16 element from slice if it exist

func DeleteUint16All

func DeleteUint16All(s []uint16, e uint16) []uint16

DeleteUint16All delete all uint16 element from slice if it exist

func DeleteUint32

func DeleteUint32(s []uint32, e uint32) []uint32

DeleteUint32 delete an uint32 element from slice if it exist

func DeleteUint32All

func DeleteUint32All(s []uint32, e uint32) []uint32

DeleteUint32All delete all uint32 element from slice if it exist

func DeleteUint64

func DeleteUint64(s []uint64, e uint64) []uint64

DeleteUint64 delete an uint64 element from slice if it exist

func DeleteUint64All

func DeleteUint64All(s []uint64, e uint64) []uint64

DeleteUint64All delete all uint64 element from slice if it exist

func DeleteUint8

func DeleteUint8(s []uint8, e uint8) []uint8

DeleteUint8 delete an uint8 element from slice if it exist

func DeleteUint8All

func DeleteUint8All(s []uint8, e uint8) []uint8

DeleteUint8All delete all uint8 element from slice if it exist

func DeleteUintAll

func DeleteUintAll(s []uint, e uint) []uint

DeleteUintAll delete all uint element from slice if it exist

func MaxByte

func MaxByte(x, y byte) byte

MaxByte returns the max value

func MaxFloat64

func MaxFloat64(x, y float64) float64

MaxFloat64 returns the max value

func MaxInt

func MaxInt(x, y int) int

MaxInt returns the max value

func MaxInt16

func MaxInt16(x, y int16) int16

MaxInt16 returns the max value

func MaxInt32

func MaxInt32(x, y int32) int32

MaxInt32 returns the max value

func MaxInt64

func MaxInt64(x, y int64) int64

MaxInt64 returns the max value

func MaxInt8

func MaxInt8(x, y int8) int8

MaxInt8 returns the max value

func MaxUint

func MaxUint(x, y uint) uint

MaxUint returns the max value

func MaxUint16

func MaxUint16(x, y uint16) uint16

MaxUint16 returns the max value

func MaxUint32

func MaxUint32(x, y uint32) uint32

MaxUint32 returns the max value

func MaxUint64

func MaxUint64(x, y uint64) uint64

MaxUint64 returns the max value

func MaxUint8

func MaxUint8(x, y uint8) uint8

MaxUint8 returns the max value

func MinByte

func MinByte(x, y byte) byte

MinByte returns the min value

func MinFloat64

func MinFloat64(x, y float64) float64

MinFloat64 returns the min value

func MinInt

func MinInt(x, y int) int

MinInt returns the min value

func MinInt16

func MinInt16(x, y int16) int16

MinInt16 returns the min value

func MinInt32

func MinInt32(x, y int32) int32

MinInt32 returns the min value

func MinInt64

func MinInt64(x, y int64) int64

MinInt64 returns the min value

func MinInt8

func MinInt8(x, y int8) int8

MinInt8 returns the min value

func MinUint

func MinUint(x, y uint) uint

MinUint returns the min value

func MinUint16

func MinUint16(x, y uint16) uint16

MinUint16 returns the min value

func MinUint32

func MinUint32(x, y uint32) uint32

MinUint32 returns the min value

func MinUint64

func MinUint64(x, y uint64) uint64

MinUint64 returns the min value

func MinUint8

func MinUint8(x, y uint8) uint8

MinUint8 returns the min value

func ReverseBytes

func ReverseBytes(b []byte) []byte

ReverseBytes reverse []byte

func SearchInt16s

func SearchInt16s(a []int16, x int16) int

SearchInt16s searches for x in a sorted slice of int16s and returns the index as specified by Search. The return value is the index to insert x if x is not present (it could be len(a)). The slice must be sorted in ascending order.

func SearchInt32s

func SearchInt32s(a []int32, x int32) int

SearchInt32s searches for x in a sorted slice of int32s and returns the index as specified by Search. The return value is the index to insert x if x is not present (it could be len(a)). The slice must be sorted in ascending order.

func SearchInt64s

func SearchInt64s(a []int64, x int64) int

SearchInt64s searches for x in a sorted slice of int64s and returns the index as specified by Search. The return value is the index to insert x if x is not present (it could be len(a)). The slice must be sorted in ascending order.

func SearchInt8s

func SearchInt8s(a []int8, x int8) int

SearchInt8s searches for x in a sorted slice of int8s and returns the index as specified by Search. The return value is the index to insert x if x is not present (it could be len(a)). The slice must be sorted in ascending order.

func SearchUint16s

func SearchUint16s(a []uint16, x uint16) int

SearchUint16s searches for x in a sorted slice of uint16s and returns the index as specified by Search. The return value is the index to insert x if x is not present (it could be len(a)). The slice must be sorted in ascending order.

func SearchUint32s

func SearchUint32s(a []uint32, x uint32) int

SearchUint32s searches for x in a sorted slice of uint32s and returns the index as specified by Search. The return value is the index to insert x if x is not present (it could be len(a)). The slice must be sorted in ascending order.

func SearchUint64s

func SearchUint64s(a []uint64, x uint64) int

SearchUint64s searches for x in a sorted slice of uint64s and returns the index as specified by Search. The return value is the index to insert x if x is not present (it could be len(a)). The slice must be sorted in ascending order.

func SearchUint8s

func SearchUint8s(a []uint8, x uint8) int

SearchUint8s searches for x in a sorted slice of uint8s and returns the index as specified by Search. The return value is the index to insert x if x is not present (it could be len(a)). The slice must be sorted in ascending order.

func SearchUints

func SearchUints(a []uint, x uint) int

SearchUints searches for x in a sorted slice of uints and returns the index as specified by Search. The return value is the index to insert x if x is not present (it could be len(a)). The slice must be sorted in ascending order.

func UniqueFloat64s

func UniqueFloat64s(a []float64) []float64

UniqueFloat64s takes an input slice of float64s and returns a new slice of float64s without duplicate values.

func UniqueInt16s

func UniqueInt16s(a []int16) []int16

UniqueInt16s takes an input slice of int16s and returns a new slice of int16s without duplicate values.

func UniqueInt32s

func UniqueInt32s(a []int32) []int32

UniqueInt32s takes an input slice of int32s and returns a new slice of int32s without duplicate values.

func UniqueInt64s

func UniqueInt64s(a []int64) []int64

UniqueInt64s takes an input slice of int64s and returns a new slice of int64s without duplicate values.

func UniqueInt8s

func UniqueInt8s(a []int8) []int8

UniqueInt8s takes an input slice of int8s and returns a new slice of int8s without duplicate values.

func UniqueInts

func UniqueInts(a []int) []int

UniqueInts takes an input slice of ints and returns a new slice of ints without duplicate values.

func UniqueUint16s

func UniqueUint16s(a []uint16) []uint16

UniqueUint16s takes an input slice of uint16s and returns a new slice of uint16s without duplicate values.

func UniqueUint32s

func UniqueUint32s(a []uint32) []uint32

UniqueUint32s takes an input slice of uint32s and returns a new slice of uint32s without duplicate values.

func UniqueUint64s

func UniqueUint64s(a []uint64) []uint64

UniqueUint64s takes an input slice of uint64s and returns a new slice of uint64s without duplicate values.

func UniqueUint8s

func UniqueUint8s(a []uint8) []uint8

UniqueUint8s takes an input slice of uint8s and returns a new slice of uint8s without duplicate values.

func UniqueUints

func UniqueUints(a []uint) []uint

UniqueUints takes an input slice of uints and returns a new slice of uints without duplicate values.

Types

type Int16Slice

type Int16Slice []int16

Int16Slice attaches the methods of Interface to []int16, sorting a increasing order.

func (Int16Slice) Len

func (p Int16Slice) Len() int

func (Int16Slice) Less

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

func (Int16Slice) Search

func (p Int16Slice) Search(x int16) int

Search returns the result of applying SearchInts to the receiver and x.

func (Int16Slice) Sort

func (p Int16Slice) Sort()

Sort is a convenience method.

func (Int16Slice) Swap

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

type Int32Slice

type Int32Slice []int32

Int32Slice attaches the methods of Interface to []int32, sorting a increasing order.

func (Int32Slice) Len

func (p Int32Slice) Len() int

func (Int32Slice) Less

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

func (Int32Slice) Search

func (p Int32Slice) Search(x int32) int

Search returns the result of applying SearchInts to the receiver and x.

func (Int32Slice) Sort

func (p Int32Slice) Sort()

Sort is a convenience method.

func (Int32Slice) Swap

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

type Int64Slice

type Int64Slice []int64

Int64Slice attaches the methods of Interface to []int64, sorting a increasing order.

func (Int64Slice) Len

func (p Int64Slice) Len() int

func (Int64Slice) Less

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

func (Int64Slice) Search

func (p Int64Slice) Search(x int64) int

Search returns the result of applying SearchInts to the receiver and x.

func (Int64Slice) Sort

func (p Int64Slice) Sort()

Sort is a convenience method.

func (Int64Slice) Swap

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

type Int8Slice

type Int8Slice []int8

Int8Slice attaches the methods of Interface to []int8, sorting a increasing order.

func (Int8Slice) Len

func (p Int8Slice) Len() int

func (Int8Slice) Less

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

func (Int8Slice) Search

func (p Int8Slice) Search(x int8) int

Search returns the result of applying SearchInts to the receiver and x.

func (Int8Slice) Sort

func (p Int8Slice) Sort()

Sort is a convenience method.

func (Int8Slice) Swap

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

type Uint16Slice

type Uint16Slice []uint16

Uint16Slice attaches the methods of Interface to []uint16, sorting a increasing order.

func (Uint16Slice) Len

func (p Uint16Slice) Len() int

func (Uint16Slice) Less

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

func (Uint16Slice) Search

func (p Uint16Slice) Search(x uint16) int

Search returns the result of applying SearchInts to the receiver and x.

func (Uint16Slice) Sort

func (p Uint16Slice) Sort()

Sort is a convenience method.

func (Uint16Slice) Swap

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

type Uint32Slice

type Uint32Slice []uint32

Uint32Slice attaches the methods of Interface to []uint, sorting a increasing order.

func (Uint32Slice) Len

func (p Uint32Slice) Len() int

func (Uint32Slice) Less

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

func (Uint32Slice) Search

func (p Uint32Slice) Search(x uint32) int

Search returns the result of applying SearchInts to the receiver and x.

func (Uint32Slice) Sort

func (p Uint32Slice) Sort()

Sort is a convenience method.

func (Uint32Slice) Swap

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

type Uint64Slice

type Uint64Slice []uint64

Uint64Slice attaches the methods of Interface to []uint64, sorting a increasing order.

func (Uint64Slice) Len

func (p Uint64Slice) Len() int

func (Uint64Slice) Less

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

func (Uint64Slice) Search

func (p Uint64Slice) Search(x uint64) int

Search returns the result of applying SearchInts to the receiver and x.

func (Uint64Slice) Sort

func (p Uint64Slice) Sort()

Sort is a convenience method.

func (Uint64Slice) Swap

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

type Uint8Slice

type Uint8Slice []uint8

Uint8Slice attaches the methods of Interface to []uint8, sorting a increasing order.

func (Uint8Slice) Len

func (p Uint8Slice) Len() int

func (Uint8Slice) Less

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

func (Uint8Slice) Search

func (p Uint8Slice) Search(x uint8) int

Search returns the result of applying SearchInts to the receiver and x.

func (Uint8Slice) Sort

func (p Uint8Slice) Sort()

Sort is a convenience method.

func (Uint8Slice) Swap

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

type UintSlice

type UintSlice []uint

UintSlice attaches the methods of Interface to []uint, sorting a increasing order.

func (UintSlice) Len

func (p UintSlice) Len() int

func (UintSlice) Less

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

func (UintSlice) Search

func (p UintSlice) Search(x uint) int

Search returns the result of applying SearchInts to the receiver and x.

func (UintSlice) Sort

func (p UintSlice) Sort()

Sort is a convenience method.

func (UintSlice) Swap

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

Jump to

Keyboard shortcuts

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