funcs

package
v9.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2022 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package funcs provides some useful generic functions.

Index

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 GT

func GT[T constraints.Ordered](v1, v2 T) bool

GT reports whether v1 is greater than v2.

func LE

func LE[T constraints.Ordered](v1, v2 T) bool

LE reports whether v1 is less than or equal to v2.

func LT

func LT[T constraints.Ordered](v1, v2 T) bool

LT reports whether v1 is less than 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.

Jump to

Keyboard shortcuts

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