Documentation
¶
Index ¶
- func Abs[T Number](n T) T
- func GCD[T Integer](a, b T) T
- func IsMonotonicWithinRange[S ~[]T, T Number](in S, minDiff, maxDiff T) bool
- func LCM[T Integer](a, b T) T
- func Max[T Number](nums ...T) T
- func MaxN[T Number](nums []T, n int) []T
- func Min[T Number](nums ...T) T
- func MinBranchless[T Number](nums ...T) T
- func MinMax[T Number](nums ...T) (T, T)
- func MinN[T Number](nums []T, n int) []T
- func MinTraditional[T Number](nums ...T) T
- func Pow[T Number](base T, exponent T) T
- func Product[T Number](vector []T) T
- func Sign[T Signed](n T) T
- func Sum[T Number](vector []T) T
- func ToF[T Number](in T) float64
- func Within[T Number](n, lowerBound, upperBound T) bool
- type Integer
- type Number
- type Point
- func (p Point) Add(other Point) Point
- func (p Point) Equal(other Point) bool
- func (p Point) EuclideanDist(other Point) float64
- func (p Point) ManhattanDist(other Point) int
- func (p Point) Max(other Point) Point
- func (p Point) Min(other Point) Point
- func (p Point) String() string
- func (p Point) Sub(other Point) Point
- type Signed
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsMonotonicWithinRange ¶
func MinBranchless ¶
func MinBranchless[T Number](nums ...T) T
func MinTraditional ¶
func MinTraditional[T Number](nums ...T) T
Types ¶
type Point ¶
type Point struct {
X, Y int
}
func (Point) EuclideanDist ¶
func (Point) ManhattanDist ¶
Click to show internal directories.
Click to hide internal directories.