Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrNoValue = errors.New(`No values provided`)
)
Functions ¶
func Clamp ¶
func Clamp[T constraints.Ordered](n, min, max T) T
Clamp returns n if it is in [min, max], otherwise min or max.
func InRange ¶
func InRange[T constraints.Ordered](v, min, max T) bool
InRange returns true if v is in [min, max).
func Min ¶
func Min[T constraints.Ordered](values ...T) T
Min returns the minimum value of the given values.
Types ¶
type Number ¶
type Number interface { constraints.Integer | constraints.Float }
Click to show internal directories.
Click to hide internal directories.