Documentation
¶
Overview ¶
Package giop provides a set of binary operators on scalar values for generic iterator combinators.
Index ¶
- func Add[T constraints.Number](left T, right T) T
- func And(left, right bool) bool
- func BinaryAnd[T constraints.Integer](left, right T) T
- func BinaryOr[T constraints.Integer](left, right T) T
- func BinaryXor[T constraints.Integer](left, right T) T
- func Divide[T constraints.Number](left T, right T) T
- func IntMod[T constraints.Integer](left T, right T) T
- func Max[T constraints.Ordered](left, right T) T
- func MaxBy[T any, K constraints.Ordered, Key ~func(T) K](key Key) func(T, T) T
- func MaxByCompare[T constraints.OrderedByCompare[T]](left, right T) T
- func MaxByCompareFunc[T any, F ~func(T, T) int](compare F) func(left, right T) T
- func MaxByLess[T constraints.OrderedByLess[T]](left, right T) T
- func MaxByLessFunc[T any, F ~func(T, T) bool](less F) func(left, right T) T
- func Min[T constraints.Ordered](left, right T) T
- func MinBy[T any, K constraints.Ordered, Key ~func(T) K](key Key) func(T, T) T
- func MinByCompare[T constraints.OrderedByCompare[T]](left, right T) T
- func MinByCompareFunc[T any, F ~func(T, T) int](compare F) func(left, right T) T
- func MinByLess[T constraints.OrderedByLess[T]](left, right T) T
- func MinByLessFunc[T any, F ~func(T, T) bool](less F) func(left, right T) T
- func Mod[T constraints.Float](left T, right T) T
- func Multiply[T constraints.Number](left T, right T) T
- func Or(left, right bool) bool
- func Subtract[T constraints.Number](left T, right T) T
- func Xor(left, right bool) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BinaryAnd ¶
func BinaryAnd[T constraints.Integer](left, right T) T
BinaryAnd returns the binary "and" of the left and right.
func BinaryOr ¶
func BinaryOr[T constraints.Integer](left, right T) T
BinaryOr returns the binary "or" of the left and right.
func BinaryXor ¶
func BinaryXor[T constraints.Integer](left, right T) T
BinaryXor returns the binary "xor" of the left and right.
func Divide ¶
func Divide[T constraints.Number](left T, right T) T
Divide returns integer part of left / right.
func IntMod ¶
func IntMod[T constraints.Integer](left T, right T) T
IntMod returns integer remainder of left / right.
func Max ¶
func Max[T constraints.Ordered](left, right T) T
Max returns the maximum value of the left and right.
func MaxBy ¶
func MaxBy[T any, K constraints.Ordered, Key ~func(T) K](key Key) func(T, T) T
MaxBy returns a function that returns the maximum value of the left and right using provided key function for comparison.
func MaxByCompare ¶
func MaxByCompare[T constraints.OrderedByCompare[T]](left, right T) T
MaxByCompare returns the maximum value of the left and right using Compare method for comparison.
func MaxByCompareFunc ¶
MaxByCompareFunc returns a function that returns the maximum value of the left and right using provided compare function for comparison.
func MaxByLess ¶
func MaxByLess[T constraints.OrderedByLess[T]](left, right T) T
MaxByLess returns the maximum value of the left and right using Less method for comparison.
func MaxByLessFunc ¶
MaxByLessFunc returns a function that returns the maximum value of the left and right using provided less function for comparison.
func Min ¶
func Min[T constraints.Ordered](left, right T) T
Min returns the minimum value of the left and right.
func MinBy ¶
func MinBy[T any, K constraints.Ordered, Key ~func(T) K](key Key) func(T, T) T
MinBy returns a function that returns the minimum value of the left and right using provided key function for comparison.
func MinByCompare ¶
func MinByCompare[T constraints.OrderedByCompare[T]](left, right T) T
MinByCompare returns the minimum value of the left and right using Compare method for comparison.
func MinByCompareFunc ¶
MinByCompareFunc returns a function that returns the minimum value of the left and right using provided compare function for comparison.
func MinByLess ¶
func MinByLess[T constraints.OrderedByLess[T]](left, right T) T
MinByLess returns the minimum value of the left and right using Less method for comparison.
func MinByLessFunc ¶
MinByLessFunc returns a function that returns the minimum value of the left and right using provided less function for comparison.
func Multiply ¶
func Multiply[T constraints.Number](left T, right T) T
Multiply returns product of left and right.
func Subtract ¶
func Subtract[T constraints.Number](left T, right T) T
Subtract returns difference of left and right.
Types ¶
This section is empty.