compare

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2019 License: CC0-1.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bool

func Bool(v1 bool, v2 bool) int

Bool compares the two values v1 and v2. Returns -1 if v1 < v2, 0 if v1 == v1, and +1 if v1 > v2.

func BoolSlice

func BoolSlice(S1 []bool, S2 []bool) int

BoolSlice compares the two slices S1 and S2. Returns -1 if S1 < S2, 0 if S1 == S2, and +1 if S1 > S2. Order is grlex: if #S1 < #S2 then S1 < S2, if #S1 > #S2 then S1 > S2, otherwise the first entry such that S1[i] != S2[i] is used to determine the order.

func Float32

func Float32(v1 float32, v2 float32) int

Float32 compares the two values v1 and v2. Returns -1 if v1 < v2, 0 if v1 == v1, and +1 if v1 > v2.

func Float32Slice

func Float32Slice(S1 []float32, S2 []float32) int

Float32Slice compares the two slices S1 and S2. Returns -1 if S1 < S2, 0 if S1 == S2, and +1 if S1 > S2. Order is grlex: if #S1 < #S2 then S1 < S2, if #S1 > #S2 then S1 > S2, otherwise the first entry such that S1[i] != S2[i] is used to determine the order.

func Float64

func Float64(v1 float64, v2 float64) int

Float64 compares the two values v1 and v2. Returns -1 if v1 < v2, 0 if v1 == v1, and +1 if v1 > v2.

func Float64Slice

func Float64Slice(S1 []float64, S2 []float64) int

Float64Slice compares the two slices S1 and S2. Returns -1 if S1 < S2, 0 if S1 == S2, and +1 if S1 > S2. Order is grlex: if #S1 < #S2 then S1 < S2, if #S1 > #S2 then S1 > S2, otherwise the first entry such that S1[i] != S2[i] is used to determine the order.

func Int

func Int(v1 int, v2 int) int

Int compares the two values v1 and v2. Returns -1 if v1 < v2, 0 if v1 == v1, and +1 if v1 > v2.

func Int16

func Int16(v1 int16, v2 int16) int

Int16 compares the two values v1 and v2. Returns -1 if v1 < v2, 0 if v1 == v1, and +1 if v1 > v2.

func Int16Slice

func Int16Slice(S1 []int16, S2 []int16) int

Int16Slice compares the two slices S1 and S2. Returns -1 if S1 < S2, 0 if S1 == S2, and +1 if S1 > S2. Order is grlex: if #S1 < #S2 then S1 < S2, if #S1 > #S2 then S1 > S2, otherwise the first entry such that S1[i] != S2[i] is used to determine the order.

func Int32

func Int32(v1 int32, v2 int32) int

Int32 compares the two values v1 and v2. Returns -1 if v1 < v2, 0 if v1 == v1, and +1 if v1 > v2.

func Int32Slice

func Int32Slice(S1 []int32, S2 []int32) int

Int32Slice compares the two slices S1 and S2. Returns -1 if S1 < S2, 0 if S1 == S2, and +1 if S1 > S2. Order is grlex: if #S1 < #S2 then S1 < S2, if #S1 > #S2 then S1 > S2, otherwise the first entry such that S1[i] != S2[i] is used to determine the order.

func Int64

func Int64(v1 int64, v2 int64) int

Int64 compares the two values v1 and v2. Returns -1 if v1 < v2, 0 if v1 == v1, and +1 if v1 > v2.

func Int64Slice

func Int64Slice(S1 []int64, S2 []int64) int

Int64Slice compares the two slices S1 and S2. Returns -1 if S1 < S2, 0 if S1 == S2, and +1 if S1 > S2. Order is grlex: if #S1 < #S2 then S1 < S2, if #S1 > #S2 then S1 > S2, otherwise the first entry such that S1[i] != S2[i] is used to determine the order.

func Int8

func Int8(v1 int8, v2 int8) int

Int8 compares the two values v1 and v2. Returns -1 if v1 < v2, 0 if v1 == v1, and +1 if v1 > v2.

func Int8Slice

func Int8Slice(S1 []int8, S2 []int8) int

Int8Slice compares the two slices S1 and S2. Returns -1 if S1 < S2, 0 if S1 == S2, and +1 if S1 > S2. Order is grlex: if #S1 < #S2 then S1 < S2, if #S1 > #S2 then S1 > S2, otherwise the first entry such that S1[i] != S2[i] is used to determine the order.

func IntSlice

func IntSlice(S1 []int, S2 []int) int

IntSlice compares the two slices S1 and S2. Returns -1 if S1 < S2, 0 if S1 == S2, and +1 if S1 > S2. Order is grlex: if #S1 < #S2 then S1 < S2, if #S1 > #S2 then S1 > S2, otherwise the first entry such that S1[i] != S2[i] is used to determine the order.

func MaxAndIndexInt

func MaxAndIndexInt(S ...int) (int, int)

MaxAndIndexInt returns the largest value in the slice S, along with the index of the first occurrence of that value in S. If S is empty then 0 is returned, and the index will be -1.

func MaxAndIndexInt16

func MaxAndIndexInt16(S ...int16) (int16, int)

MaxAndIndexInt16 returns the largest value in the slice S, along with the index of the first occurrence of that value in S. If S is empty then 0 is returned, and the index will be -1.

func MaxAndIndexInt32

func MaxAndIndexInt32(S ...int32) (int32, int)

MaxAndIndexInt32 returns the largest value in the slice S, along with the index of the first occurrence of that value in S. If S is empty then 0 is returned, and the index will be -1.

func MaxAndIndexInt64

func MaxAndIndexInt64(S ...int64) (int64, int)

MaxAndIndexInt64 returns the largest value in the slice S, along with the index of the first occurrence of that value in S. If S is empty then 0 is returned, and the index will be -1.

func MaxAndIndexInt8

func MaxAndIndexInt8(S ...int8) (int8, int)

MaxAndIndexInt8 returns the largest value in the slice S, along with the index of the first occurrence of that value in S. If S is empty then 0 is returned, and the index will be -1.

func MaxAndIndexUint

func MaxAndIndexUint(S ...uint) (uint, int)

MaxAndIndexUint returns the largest value in the slice S, along with the index of the first occurrence of that value in S. If S is empty then 0 is returned, and the index will be -1.

func MaxAndIndexUint16

func MaxAndIndexUint16(S ...uint16) (uint16, int)

MaxAndIndexUint16 returns the largest value in the slice S, along with the index of the first occurrence of that value in S. If S is empty then 0 is returned, and the index will be -1.

func MaxAndIndexUint32

func MaxAndIndexUint32(S ...uint32) (uint32, int)

MaxAndIndexUint32 returns the largest value in the slice S, along with the index of the first occurrence of that value in S. If S is empty then 0 is returned, and the index will be -1.

func MaxAndIndexUint64

func MaxAndIndexUint64(S ...uint64) (uint64, int)

MaxAndIndexUint64 returns the largest value in the slice S, along with the index of the first occurrence of that value in S. If S is empty then 0 is returned, and the index will be -1.

func MaxAndIndexUint8

func MaxAndIndexUint8(S ...uint8) (uint8, int)

MaxAndIndexUint8 returns the largest value in the slice S, along with the index of the first occurrence of that value in S. If S is empty then 0 is returned, and the index will be -1.

func MaxInt

func MaxInt(S ...int) int

MaxInt returns the largest value in the slice S. If S is empty then 0 is returned.

func MaxInt16

func MaxInt16(S ...int16) int16

MaxInt16 returns the largest value in the slice S. If S is empty then 0 is returned.

func MaxInt32

func MaxInt32(S ...int32) int32

MaxInt32 returns the largest value in the slice S. If S is empty then 0 is returned.

func MaxInt64

func MaxInt64(S ...int64) int64

MaxInt64 returns the largest value in the slice S. If S is empty then 0 is returned.

func MaxInt8

func MaxInt8(S ...int8) int8

MaxInt8 returns the largest value in the slice S. If S is empty then 0 is returned.

func MaxOfPairInt

func MaxOfPairInt(v1 int, v2 int) int

MaxOfPairInt returns the larger of the two given values.

func MaxOfPairInt16

func MaxOfPairInt16(v1 int16, v2 int16) int16

MaxOfPairInt16 returns the larger of the two given values.

func MaxOfPairInt32

func MaxOfPairInt32(v1 int32, v2 int32) int32

MaxOfPairInt32 returns the larger of the two given values.

func MaxOfPairInt64

func MaxOfPairInt64(v1 int64, v2 int64) int64

MaxOfPairInt64 returns the larger of the two given values.

func MaxOfPairInt8

func MaxOfPairInt8(v1 int8, v2 int8) int8

MaxOfPairInt8 returns the larger of the two given values.

func MaxOfPairUint

func MaxOfPairUint(v1 uint, v2 uint) uint

MaxOfPairUint returns the larger of the two given values.

func MaxOfPairUint16

func MaxOfPairUint16(v1 uint16, v2 uint16) uint16

MaxOfPairUint16 returns the larger of the two given values.

func MaxOfPairUint32

func MaxOfPairUint32(v1 uint32, v2 uint32) uint32

MaxOfPairUint32 returns the larger of the two given values.

func MaxOfPairUint64

func MaxOfPairUint64(v1 uint64, v2 uint64) uint64

MaxOfPairUint64 returns the larger of the two given values.

func MaxOfPairUint8

func MaxOfPairUint8(v1 uint8, v2 uint8) uint8

MaxOfPairUint8 returns the larger of the two given values.

func MaxUint

func MaxUint(S ...uint) uint

MaxUint returns the largest value in the slice S. If S is empty then 0 is returned.

func MaxUint16

func MaxUint16(S ...uint16) uint16

MaxUint16 returns the largest value in the slice S. If S is empty then 0 is returned.

func MaxUint32

func MaxUint32(S ...uint32) uint32

MaxUint32 returns the largest value in the slice S. If S is empty then 0 is returned.

func MaxUint64

func MaxUint64(S ...uint64) uint64

MaxUint64 returns the largest value in the slice S. If S is empty then 0 is returned.

func MaxUint8

func MaxUint8(S ...uint8) uint8

MaxUint8 returns the largest value in the slice S. If S is empty then 0 is returned.

func MinAndIndexInt

func MinAndIndexInt(S ...int) (int, int)

MinAndIndexInt returns the smallest value in the slice S, along with the index of the first occurrence of that value in S. If S is empty then 0 is returned, and the index will be -1.

func MinAndIndexInt16

func MinAndIndexInt16(S ...int16) (int16, int)

MinAndIndexInt16 returns the smallest value in the slice S, along with the index of the first occurrence of that value in S. If S is empty then 0 is returned, and the index will be -1.

func MinAndIndexInt32

func MinAndIndexInt32(S ...int32) (int32, int)

MinAndIndexInt32 returns the smallest value in the slice S, along with the index of the first occurrence of that value in S. If S is empty then 0 is returned, and the index will be -1.

func MinAndIndexInt64

func MinAndIndexInt64(S ...int64) (int64, int)

MinAndIndexInt64 returns the smallest value in the slice S, along with the index of the first occurrence of that value in S. If S is empty then 0 is returned, and the index will be -1.

func MinAndIndexInt8

func MinAndIndexInt8(S ...int8) (int8, int)

MinAndIndexInt8 returns the smallest value in the slice S, along with the index of the first occurrence of that value in S. If S is empty then 0 is returned, and the index will be -1.

func MinAndIndexUint

func MinAndIndexUint(S ...uint) (uint, int)

MinAndIndexUint returns the smallest value in the slice S, along with the index of the first occurrence of that value in S. If S is empty then 0 is returned, and the index will be -1.

func MinAndIndexUint16

func MinAndIndexUint16(S ...uint16) (uint16, int)

MinAndIndexUint16 returns the smallest value in the slice S, along with the index of the first occurrence of that value in S. If S is empty then 0 is returned, and the index will be -1.

func MinAndIndexUint32

func MinAndIndexUint32(S ...uint32) (uint32, int)

MinAndIndexUint32 returns the smallest value in the slice S, along with the index of the first occurrence of that value in S. If S is empty then 0 is returned, and the index will be -1.

func MinAndIndexUint64

func MinAndIndexUint64(S ...uint64) (uint64, int)

MinAndIndexUint64 returns the smallest value in the slice S, along with the index of the first occurrence of that value in S. If S is empty then 0 is returned, and the index will be -1.

func MinAndIndexUint8

func MinAndIndexUint8(S ...uint8) (uint8, int)

MinAndIndexUint8 returns the smallest value in the slice S, along with the index of the first occurrence of that value in S. If S is empty then 0 is returned, and the index will be -1.

func MinInt

func MinInt(S ...int) int

MinInt returns the smallest value in the slice S. If S is empty then 0 is returned.

func MinInt16

func MinInt16(S ...int16) int16

MinInt16 returns the smallest value in the slice S. If S is empty then 0 is returned.

func MinInt32

func MinInt32(S ...int32) int32

MinInt32 returns the smallest value in the slice S. If S is empty then 0 is returned.

func MinInt64

func MinInt64(S ...int64) int64

MinInt64 returns the smallest value in the slice S. If S is empty then 0 is returned.

func MinInt8

func MinInt8(S ...int8) int8

MinInt8 returns the smallest value in the slice S. If S is empty then 0 is returned.

func MinOfPairInt

func MinOfPairInt(v1 int, v2 int) int

MinOfPairInt returns the smaller of the two given values.

func MinOfPairInt16

func MinOfPairInt16(v1 int16, v2 int16) int16

MinOfPairInt16 returns the smaller of the two given values.

func MinOfPairInt32

func MinOfPairInt32(v1 int32, v2 int32) int32

MinOfPairInt32 returns the smaller of the two given values.

func MinOfPairInt64

func MinOfPairInt64(v1 int64, v2 int64) int64

MinOfPairInt64 returns the smaller of the two given values.

func MinOfPairInt8

func MinOfPairInt8(v1 int8, v2 int8) int8

MinOfPairInt8 returns the smaller of the two given values.

func MinOfPairUint

func MinOfPairUint(v1 uint, v2 uint) uint

MinOfPairUint returns the smaller of the two given values.

func MinOfPairUint16

func MinOfPairUint16(v1 uint16, v2 uint16) uint16

MinOfPairUint16 returns the smaller of the two given values.

func MinOfPairUint32

func MinOfPairUint32(v1 uint32, v2 uint32) uint32

MinOfPairUint32 returns the smaller of the two given values.

func MinOfPairUint64

func MinOfPairUint64(v1 uint64, v2 uint64) uint64

MinOfPairUint64 returns the smaller of the two given values.

func MinOfPairUint8

func MinOfPairUint8(v1 uint8, v2 uint8) uint8

MinOfPairUint8 returns the smaller of the two given values.

func MinUint

func MinUint(S ...uint) uint

MinUint returns the smallest value in the slice S. If S is empty then 0 is returned.

func MinUint16

func MinUint16(S ...uint16) uint16

MinUint16 returns the smallest value in the slice S. If S is empty then 0 is returned.

func MinUint32

func MinUint32(S ...uint32) uint32

MinUint32 returns the smallest value in the slice S. If S is empty then 0 is returned.

func MinUint64

func MinUint64(S ...uint64) uint64

MinUint64 returns the smallest value in the slice S. If S is empty then 0 is returned.

func MinUint8

func MinUint8(S ...uint8) uint8

MinUint8 returns the smallest value in the slice S. If S is empty then 0 is returned.

func String

func String(v1 string, v2 string) int

String compares the two values v1 and v2. Returns -1 value if v1 < v2, 0 if v1 == v1, and +1 if v1 > v2.

func StringSlice

func StringSlice(S1 []string, S2 []string) int

StringSlice compares the two slices S1 and S2. Returns -1 if S1 < S2, 0 if S1 == S2, and +1 if S1 > S2. Order is grlex: if #S1 < #S2 then S1 < S2, if #S1 > #S2 then S1 > S2, otherwise the first entry such that S1[i] != S2[i] is used to determine the order.

func Time

func Time(v1 time.Time, v2 time.Time) int

Time compares the two values v1 and v2. Returns -1 if v1 < v2, 0 if v1 == v1, and +1 if v1 > v2.

func Uint

func Uint(v1 uint, v2 uint) int

Uint compares the two values v1 and v2. Returns -1 if v1 < v2, 0 if v1 == v1, and +1 if v1 > v2.

func Uint16

func Uint16(v1 uint16, v2 uint16) int

Uint16 compares the two values v1 and v2. Returns -1 if v1 < v2, 0 if v1 == v1, and +1 if v1 > v2.

func Uint16Slice

func Uint16Slice(S1 []uint16, S2 []uint16) int

Uint16Slice compares the two slices S1 and S2. Returns -1 if S1 < S2, 0 if S1 == S2, and +1 if S1 > S2. Order is grlex: if #S1 < #S2 then S1 < S2, if #S1 > #S2 then S1 > S2, otherwise the first entry such that S1[i] != S2[i] is used to determine the order.

func Uint32

func Uint32(v1 uint32, v2 uint32) int

Uint32 compares the two values v1 and v2. Returns -1 if v1 < v2, 0 if v1 == v1, and +1 if v1 > v2.

func Uint32Slice

func Uint32Slice(S1 []uint32, S2 []uint32) int

Uint32Slice compares the two slices S1 and S2. Returns -1 if S1 < S2, 0 if S1 == S2, and +1 if S1 > S2. Order is grlex: if #S1 < #S2 then S1 < S2, if #S1 > #S2 then S1 > S2, otherwise the first entry such that S1[i] != S2[i] is used to determine the order.

func Uint64

func Uint64(v1 uint64, v2 uint64) int

Uint64 compares the two values v1 and v2. Returns -1 if v1 < v2, 0 if v1 == v1, and +1 if v1 > v2.

func Uint64Slice

func Uint64Slice(S1 []uint64, S2 []uint64) int

Uint64Slice compares the two slices S1 and S2. Returns -1 if S1 < S2, 0 if S1 == S2, and +1 if S1 > S2. Order is grlex: if #S1 < #S2 then S1 < S2, if #S1 > #S2 then S1 > S2, otherwise the first entry such that S1[i] != S2[i] is used to determine the order.

func Uint8

func Uint8(v1 uint8, v2 uint8) int

Uint8 compares the two values v1 and v2. Returns -1 if v1 < v2, 0 if v1 == v1, and +1 if v1 > v2.

func Uint8Slice

func Uint8Slice(S1 []uint8, S2 []uint8) int

Uint8Slice compares the two slices S1 and S2. Returns -1 if S1 < S2, 0 if S1 == S2, and +1 if S1 > S2. Order is grlex: if #S1 < #S2 then S1 < S2, if #S1 > #S2 then S1 > S2, otherwise the first entry such that S1[i] != S2[i] is used to determine the order.

func UintSlice

func UintSlice(S1 []uint, S2 []uint) int

UintSlice compares the two slices S1 and S2. Returns -1 if S1 < S2, 0 if S1 == S2, and +1 if S1 > S2. Order is grlex: if #S1 < #S2 then S1 < S2, if #S1 > #S2 then S1 > S2, otherwise the first entry such that S1[i] != S2[i] is used to determine the order.

Types

This section is empty.

Jump to

Keyboard shortcuts

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