Documentation ¶
Overview ¶
Package mathutil implements some functions for math calculation.
Index ¶
- func Average[T lancetconstraints.Number](numbers ...T) T
- func Exponent(x, n int64) int64
- func Factorial(x uint) uint
- func Fibonacci(first, second, n int) int
- func Max[T lancetconstraints.Number](numbers ...T) T
- func Min[T lancetconstraints.Number](numbers ...T) T
- func Percent(val, total float64, n int) float64
- func RoundToFloat(x float64, n int) float64
- func RoundToString(x float64, n int) string
- func TruncRound(x float64, n int) float64
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Average ¶ added in v2.0.1
func Average[T lancetconstraints.Number](numbers ...T) T
Average return average value of params
func Max ¶ added in v2.0.1
func Max[T lancetconstraints.Number](numbers ...T) T
Max return max value of params
func Min ¶ added in v2.0.1
func Min[T lancetconstraints.Number](numbers ...T) T
Min return min value of params
func RoundToFloat ¶
RoundToFloat round up to n decimal places
func RoundToString ¶
RoundToString round up to n decimal places
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.