Documentation ¶
Overview ¶
Package funcs provides some useful generic functions.
Index ¶
- func Compare[T constraints.Ordered](v1, v2 T) int
- func GE[T constraints.Ordered](v1, v2 T) bool
- func GT[T constraints.Ordered](v1, v2 T) bool
- func LE[T constraints.Ordered](v1, v2 T) bool
- func LT[T constraints.Ordered](v1, v2 T) bool
- func Max[T constraints.Ordered](v1, v2 T) T
- func Min[T constraints.Ordered](v1, v2 T) T
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Compare ¶
func Compare[T constraints.Ordered](v1, v2 T) int
Compare compares v1 and v2, and returns
-1 if v1 < v2 0 if v1 == v2 1 if v1 > v2
func GE ¶
func GE[T constraints.Ordered](v1, v2 T) bool
GE reports whether v1 is greater than or equal to v2.
func LE ¶
func LE[T constraints.Ordered](v1, v2 T) bool
LE reports whether v1 is less than or equal to v2.
func Max ¶
func Max[T constraints.Ordered](v1, v2 T) T
Max returns the maximum one between v1 and v2.
func Min ¶
func Min[T constraints.Ordered](v1, v2 T) T
Min returns the minimal one between v1 and v2.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.