Documentation ¶
Index ¶
- func IsPrime(n int) bool
- func NextPrime(n int) int
- func PrimeFactors(n int) []int
- func SliceClone[T any](ts []T) []T
- func SliceContainsMany[T comparable](ts []T, ots []T) bool
- func SliceContainsOne[T comparable](ts []T, t T) bool
- func SliceFindIdx[T comparable](ts []T, t T) int
- func SliceOf[T constraints.Integer](min, max T) []T
- func SliceProduct[T constraints.Integer | constraints.Float](ts []T) T
- func SliceRemain[T comparable](from []T, in []T) []T
- func SliceRemoveIdx[T any](ts []T, ri int) []T
- func SliceSum[T constraints.Integer | constraints.Float](ts []T) T
- func SliceSumFunc[T constraints.Integer | constraints.Float](ts []T, transform func(t T) T) T
- func SmallestMultipleOf(ns ...int) int
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PrimeFactors ¶
func SliceClone ¶
func SliceClone[T any](ts []T) []T
func SliceContainsMany ¶
func SliceContainsMany[T comparable](ts []T, ots []T) bool
func SliceContainsOne ¶
func SliceContainsOne[T comparable](ts []T, t T) bool
func SliceFindIdx ¶
func SliceFindIdx[T comparable](ts []T, t T) int
func SliceOf ¶
func SliceOf[T constraints.Integer](min, max T) []T
func SliceProduct ¶
func SliceProduct[T constraints.Integer | constraints.Float](ts []T) T
func SliceRemain ¶
func SliceRemain[T comparable](from []T, in []T) []T
func SliceRemoveIdx ¶
func SliceSum ¶
func SliceSum[T constraints.Integer | constraints.Float](ts []T) T
func SliceSumFunc ¶
func SliceSumFunc[T constraints.Integer | constraints.Float](ts []T, transform func(t T) T) T
func SmallestMultipleOf ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.