Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Abs ¶
func Abs[T constraints.Signed | constraints.Float](a T) T
Abs is a generic function that returns the absolute value of a signed or floating-point number.
func Floor ¶
func Floor[T constraints.Float](a T) T
Floor is a generic function that rounds down a floating-point value to the nearest integer.
func GeneratePermutations ¶
GeneratePermutations is a function that generates permutations of length 2 for the input slice
func LowerBound ¶
func LowerBound[T constraints.Ordered](array []T, target T) (int, error)
LowerBound is a generic function that performs a lower bound search on a sorted array. It searches for the first element in the array that is greater than or equal to the target value. The function takes in a sorted array and the target value as parameters and returns the index of the found element. If the target value is greater than all elements in the array, an error is returned.
func Max ¶
func Max[T constraints.Ordered](a, b T) T
Max is a generic function that returns the maximum value between two ordered elements.
func ToBoolArray ¶
ToBoolArray converts single byte into array of booleans. Significance of bits in resulting array is in a descending order.
Types ¶
This section is empty.