math

package
v1.2.62 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2023 License: MIT Imports: 2 Imported by: 1

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 Dim

func Dim[T constraints_.Number](x, y T) T

Dim returns the maximum of x-y or 0.

func Max

func Max[T constraints.Ordered](s ...T) T

Max returns the largest of s.

func Min

func Min[T constraints.Ordered](s ...T) T

Min returns the smallest of s.

Types

This section is empty.

Jump to

Keyboard shortcuts

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