common

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2025 License: MIT-0 Imports: 2 Imported by: 0

README

go-common

some common go functions I use in my projects

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Abs

func Abs[T constraints.Signed | constraints.Float](num T) T

func Round

func Round[T constraints.Float](val T, precision uint) T

func RoundEven

func RoundEven[T constraints.Integer | constraints.Float](val T) T

func SliceAvgMinMax

func SliceAvgMinMax[T constraints.Float | constraints.Integer](s []T) (T, T, T)

Calculates the avg from an slice of floats or integers. Does not calculate a total sum to avoid an overflow. This often causes integers to be off by one compared to summing all elements and dividing by length.

Types

This section is empty.

Jump to

Keyboard shortcuts

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