maths

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Ceil

func Ceil[V Number](value, max V) V

func Clamp

func Clamp[V Number](value, min, max V) V

func Floor

func Floor[V Number](value, min V) V

func ReverseSortedNumbers

func ReverseSortedNumbers[K Number, V interface{}](data map[K]V) (keys []K)

func Round added in v0.4.0

func Round[V Decimal](x V) (rounded int)

func SortedNumbers

func SortedNumbers[K Number, V interface{}](data map[K]V) (keys []K)

Types

type Decimal added in v0.4.0

type Decimal interface {
	~float32 | ~float64
}

type Number

type Number interface {
	UnsignedInteger | SignedInteger | Decimal
}

type SignedInteger added in v0.4.0

type SignedInteger interface {
	~int | ~int8 | ~int16 | ~int32 | ~int64
}

type UnsignedInteger added in v0.4.0

type UnsignedInteger interface {
	~uint | ~uint8 | ~uint16 | ~uint32 | ~uint64
}

Jump to

Keyboard shortcuts

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