Documentation ¶
Index ¶
- func CeilF2I(v float64) int
- func CeilI(v, max int) int
- func ClampF(value, min, max float64) float64
- func ClampI(value, min, max int) int
- func DistInts(max int, in []int) (out []int)
- func Distribute(total, available, parts, nChildren, spacing int) (values, gaps []int, err error)
- func EqInts(a, b []int) (same bool)
- func FloorI(v, min int) int
- func InRange[T constraints.Integer](v, min, max T) (present bool)
- func IsOneOf[T constraints.Integer](v T, list ...T) (present bool)
- func SolveSpaceAlloc(nChildren, nSpace, minSpacing int) (increment int, gaps []int)
- func SumInts(ints []int) (sum int)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CeilF2I ¶
CeilF2I - Round the given floating point number to the nearest larger integer and return that as an integer.
func CeilI ¶ added in v0.5.10
CeilI - Returns the `value` given unless it's greater than `max`, in which case it returns `max`.
func ClampF ¶
ClampF - Returns the `value` given unless it's smaller than `min` or greater than `max`. If it's less than `min`, `min` is returned and if it's greater than `max` it returns `max`.
func ClampI ¶
ClampI - Returns the `value` given unless it's smaller than `min` or greater than `max`. If it's less than `min`, `min` is returned and if it's greater than `max` it returns `max`.
func Distribute ¶
Distribute - Another variation on distributing space between things.
func EqInts ¶
EqInts - Compare two integer arrays and if both are the same, returns true and false otherwise.
func FloorI ¶
FloorI - Returns the `value` given unless it's less than `min`, in which case it returns `min`.
func InRange ¶ added in v0.5.19
func InRange[T constraints.Integer](v, min, max T) (present bool)
func IsOneOf ¶ added in v0.5.19
func IsOneOf[T constraints.Integer](v T, list ...T) (present bool)
func SolveSpaceAlloc ¶
SolveSpaceAlloc - Resolve the issue of computing the gaps between things.
Types ¶
This section is empty.