palomath

package
v1.14.0 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BigIntDiv

func BigIntDiv(a, b *big.Int) math.LegacyDec

BigIntDiv Quo returns the rounded quotient a/b. Precision is set to cDivisionPrecision. Panics if both operands are zero or infinities.

func Clamp

func Clamp[E Number](n, min, max E) E

Clamp returns n clamped to [min, max]

func LegacyDecFromFloat64

func LegacyDecFromFloat64(f float64) math.LegacyDec

func Median

func Median[E Number](s []E) E

Median returns the median value of the given slice. The slice does not need to be sorted.

Types

type Number

type Number interface {
	constraints.Float | constraints.Integer
}

Jump to

Keyboard shortcuts

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