mathutil

package
v0.0.19 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2023 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Clamp

func Clamp[T Number](v, lo, hi T) T

Clamp returns a value restricted between lo and hi.

func Max

func Max[T Number](a T, rest ...T) T

Max finds the largest value of all given values

func Min

func Min[T Number](a T, rest ...T) T

Min finds the smallest value of all given values

Types

type Number

type Number interface {
	float32 | float64 | constraints.Integer
}

Number is the type that supports any form of integer or float

Jump to

Keyboard shortcuts

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