math

package
v0.0.0-...-dbc70a4 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2025 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const MaxInt = math.MaxInt
View Source
const MinInt = math.MinInt

Variables

This section is empty.

Functions

func Abs

func Abs[N Number](a N) N

func GCD

func GCD[T Int](a, b T) T

func LCM

func LCM[T Int](a, b T) T

func Pow

func Pow[N Number, M Int](x N, y M) N

func Product

func Product[T Number](nums ...T) T

func Sign

func Sign[N Snumber](a N) N

func Sum

func Sum[T Number](s ...T) T

func SumMap

func SumMap[T comparable](s map[T]int) int

func SumMapIf

func SumMapIf[T comparable](s map[T]int, predicate func(T) bool) int

Types

type Float

type Float interface {
	~float32 | ~float64
}

type Int

type Int interface {
	Sint | Uint
}

type Number

type Number interface {
	Sint | Uint | Float
}

type Sint

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

type SizedInt

type SizedInt interface {
	SizedSint | SizedUint
}

type SizedSint

type SizedSint interface {
	~int8 | ~int16 | ~int32 | ~int64
}

type SizedUint

type SizedUint interface {
	~uint8 | ~uint16 | ~uint32 | ~uint64
}

type Snumber

type Snumber interface {
	Sint | Float
}

type Uint

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

Jump to

Keyboard shortcuts

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