Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Clamp ¶ added in v1.2.38
func Clamp[T constraints.Ordered](v, lo, hi T) T
Clamp returns the value between boundary [lo,hi], as v < lo ? v : hi > v : hi : v. Reference to lo if v is less than lo, reference to hi if hi is less than v, otherwise reference to v. If v compares equivalent to either bound, returns a reference to v, not the bound.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.