Documentation ¶
Index ¶
- func Abs[T constraints.Integer | constraints.Float](x T) T
- func AngleToRadian(angle float64) float64
- func Average[T constraints.Integer | constraints.Float](numbers ...T) T
- func Cos(radian float64, precision ...int) float64
- func Exponent(x, n int64) int64
- func Factorial(x uint) uint
- func Fibonacci(first, second, n int) int
- func GCD[T constraints.Integer](integers ...T) T
- func IsPrime(n int) bool
- func LCM[T constraints.Integer](integers ...T) T
- func Log(n, base float64) float64
- func Max[T constraints.Integer | constraints.Float](numbers ...T) T
- func MaxBy[T any](slice []T, comparator func(T, T) bool) T
- func Min[T constraints.Integer | constraints.Float](numbers ...T) T
- func MinBy[T any](slice []T, comparator func(T, T) bool) T
- func Percent(val, total float64, n int) float64
- func PointDistance(x1, y1, x2, y2 float64) float64
- func RadianToAngle(radian float64) float64
- func Range[T constraints.Integer | constraints.Float](start T, count int) []T
- func RangeWithStep[T constraints.Integer | constraints.Float](start, end, step T) []T
- func RoundToFloat(x float64, n int) float64
- func RoundToString(x float64, n int) string
- func Sin(radian float64, precision ...int) float64
- func Sum[T constraints.Integer | constraints.Float](numbers ...T) T
- func TruncRound(x float64, n int) float64
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Abs ¶
func Abs[T constraints.Integer | constraints.Float](x T) T
Abs returns the absolute value of x.
func AngleToRadian ¶
AngleToRadian converts angle value to radian value.
func Average ¶
func Average[T constraints.Integer | constraints.Float](numbers ...T) T
Average return average value of numbers.
func GCD ¶
func GCD[T constraints.Integer](integers ...T) T
GCD return greatest common divisor (GCD) of integers.
func LCM ¶
func LCM[T constraints.Integer](integers ...T) T
LCM return Least Common Multiple (LCM) of integers.
func Max ¶
func Max[T constraints.Integer | constraints.Float](numbers ...T) T
Max return max value of numbers.
func Min ¶
func Min[T constraints.Integer | constraints.Float](numbers ...T) T
Min return min value of numbers.
func PointDistance ¶
PointDistance get two points distance.
func RadianToAngle ¶
RadianToAngle converts radian value to angle value.
func Range ¶
func Range[T constraints.Integer | constraints.Float](start T, count int) []T
Range creates a slice of numbers from start with specified count, element step is 1.
func RangeWithStep ¶
func RangeWithStep[T constraints.Integer | constraints.Float](start, end, step T) []T
RangeWithStep creates a slice of numbers from start to end with specified step.
func RoundToFloat ¶
RoundToFloat round up to n decimal places.
func RoundToString ¶
RoundToString round up to n decimal places.
func Sum ¶
func Sum[T constraints.Integer | constraints.Float](numbers ...T) T
Sum return sum of passed numbers.
Types ¶
This section is empty.