mathutils

package
v1.1.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Clamp

func Clamp[T cmp.Ordered](val, a, b T) T

Clamp returns a value such that it remain in range [min, max]. NOTE: the clamped range will be determined from a, b inputs.

func GetScaledValueFromIntOrPercent

func GetScaledValueFromIntOrPercent(intOrPercent *intstr.IntOrString, total int, roundUp bool, defaultValue int) int

GetScaledValueFromIntOrPercent returns a scaled value given an int or percent, otherwise returns the default value.

Types

This section is empty.

Jump to

Keyboard shortcuts

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