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.
func RingRem ¶ added in v1.2.68
func RingRem[T constraints.Integer](x, y T) T
RingRem returns the remainder of x looped by +ny until in y > 0 ? [0, y) : (y, 0]. RingRem panics for y == 0 (division by zero). y > 0, then ∈ [0, y) y < 0, then ∈ (y, 0]
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.