math

package
v0.0.0-...-cc3bc86 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IncreaseUintByPercent

func IncreaseUintByPercent(amount math.Uint, percent uint64) (math.Uint, math.Uint)

IncreaseUintByPercent is a function that increases Uint by a percentage. Example: IncreaseUintByPercent(4000, 20) = 4000 * 1,2 = 4800 Returns result and increase amount.

func Percentage

func Percentage(a, b *big.Int) *big.Float

Percentage calculates the percentage of A over B.

func SliceMedianValue

func SliceMedianValue[T number](items []T, inPlace bool) T

SliceMedianValue returns the median value of the given slice. Returns 0 for an empty slice. If inPlace is true, the input slice will be sorted in place. Otherwise, a copy of the input slice will be sorted.

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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