args

package
v0.0.0-...-05bc493 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 20, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const MaxPrime = 65581
View Source
const PrimeCount = 6550

Variables

This section is empty.

Functions

func AppendIntfArgs

func AppendIntfArgs(args []interface{}, moreArgs ...interface{}) []interface{}

func AsUint16Slice

func AsUint16Slice(v ...uint16) []uint16

func BitCountToMaxDecimalCount

func BitCountToMaxDecimalCount(bitLen int) int

func CeilingPowerOfTwo

func CeilingPowerOfTwo(x uint) uint

CeilingPowerOfTwo returns 0 for (0)

func DurationFixedLen

func DurationFixedLen(d time.Duration, expectedLen int) string

NB! "µs" require 3 bytes, not 2 bytes, hence the difference with "ms" on a number of decimal positions

func FromGrey

func FromGrey(g uint) uint

Converts a binary-reflected grey code to a linear binary number

func GCDListInt

func GCDListInt(min, a int, b ...int) int

func GCDListInt64

func GCDListInt64(min, a int64, b ...int64) int64

func GCDListUint64

func GCDListUint64(min, a uint64, b ...uint64) uint64

func GreatestCommonDivisor

func GreatestCommonDivisor(a, b int) int

func GreatestCommonDivisorInt64

func GreatestCommonDivisorInt64(a, b int64) int64

func GreatestCommonDivisorUint64

func GreatestCommonDivisorUint64(a, b uint64) uint64

func Grey

func Grey(v uint) uint

Converts a linear binary number to a binary-reflected grey code

func GreyInc

func GreyInc(v uint) uint

Gives a grey-code increment for the given binary. Result always has only one non-zero bit. The following is always true: Grey(v) ^ GreyInc(v) == Grey(v + 1)

func GreyIncBit

func GreyIncBit(v uint) uint8

Returns a bit (offset) that will change in grey-code equivalent of v on incrementing it The following is always true: 1<<GreyIncBit(v) == GreyInc(v)

func IsNil

func IsNil(v interface{}) bool

func IsPowerOfTwo

func IsPowerOfTwo(x uint) bool

IsPowerOfTwo also returns true for (0)

func LazyFmt

func LazyFmt(format string, a ...interface{}) fmt.Stringer

func LazyStr

func LazyStr(fn func() string) fmt.Stringer

func LazyTimeFmt

func LazyTimeFmt(format string, t time.Time) fmt.Stringer

func Prime

func Prime(i int) int

Types

type PrimeList

type PrimeList struct {
	// contains filtered or unexported fields
}

func IsolatedOddPrimes

func IsolatedOddPrimes() PrimeList

func OddPrimes

func OddPrimes() PrimeList

func Primes

func Primes() PrimeList

func (PrimeList) Ceiling

func (m PrimeList) Ceiling(v int) int

func (PrimeList) Floor

func (m PrimeList) Floor(v int) int

func (PrimeList) Len

func (m PrimeList) Len() int

func (PrimeList) Max

func (m PrimeList) Max() int

func (PrimeList) Min

func (m PrimeList) Min() int

func (PrimeList) Nearest

func (m PrimeList) Nearest(v int) int

func (PrimeList) Prime

func (m PrimeList) Prime(i int) int

type ShuffleFunc

type ShuffleFunc func(n int, swap func(i, j int))

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL