ints

package
v0.0.0-...-157c9c8 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: GPL-3.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MaxU   uint   = ^uint(0)
	MaxU8  uint8  = ^uint8(0)
	MaxU16 uint16 = ^uint16(0)
	MaxU32 uint32 = ^uint32(0)
	MaxU64 uint64 = ^uint64(0)

	MaxI   int   = int(MaxU >> 1)
	MaxI8  int8  = int8(MaxU8 >> 1)
	MaxI16 int16 = int16(MaxU16 >> 1)
	MaxI32 int32 = int32(MaxU32 >> 1)
	MaxI64 int64 = int64(MaxU64 >> 1)

	MinI   int   = ^MaxI
	MinI8  int8  = ^MaxI8
	MinI16 int16 = ^MaxI16
	MinI32 int32 = ^MaxI32
	MinI64 int64 = ^MaxI64
)

Variables

This section is empty.

Functions

func Compound

func Compound[T constraints.Integer](fn func(a, b T) T, ts []T) (t T)

func DivDown

func DivDown[T constraints.Integer](a, b T) T

func DivUp

func DivUp[T constraints.Integer](a, b T) T

func Float32

func Float32[T constraints.Integer](i T) float32

func Float64

func Float64[T constraints.Integer](i T) float64

func GCD

func GCD[T constraints.Integer](a, b T) T

func GCDX

func GCDX[T constraints.Integer](a, b T) (gcd, q, r T)

func Idx

func Idx(idx, ln int) (int, bool)

Idx provides a relative index to the given length. So a value of -1 will return the ln-1. The bool indicates if the index is in range.

func Int

func Int[T constraints.Integer](i T) int

func Int16

func Int16[T constraints.Integer](i T) int16

func Int32

func Int32[T constraints.Integer](i T) int32

func Int64

func Int64[T constraints.Integer](i T) int64

func Int8

func Int8[T constraints.Integer](i T) int8

func LCM

func LCM[T constraints.Integer](a, b T) T

func LCMN

func LCMN[T constraints.Integer](ns ...T) T

func Mod

func Mod[T constraints.Integer](a, b T) T

func Prod

func Prod[T constraints.Integer](ns ...T) T

func ProdFn

func ProdFn[T constraints.Integer](a, b T) T

func SumFn

func SumFn[T constraints.Integer](a, b T) T

func Uint

func Uint[T constraints.Integer](i T) uint

func Uint16

func Uint16[T constraints.Integer](i T) uint16

func Uint32

func Uint32[T constraints.Integer](i T) uint32

func Uint64

func Uint64[T constraints.Integer](i T) uint64

func Uint8

func Uint8[T constraints.Integer](i T) uint8

Types

type Combinator

type Combinator[I constraints.Integer] func(idx I) []I

func Cross

func Cross[I constraints.Integer](lns ...I) (Combinator[I], I)

func Pair

func Pair[I constraints.Integer](lns ...I) (Combinator[I], I)

type CombinatorFactory

type CombinatorFactory[I constraints.Integer] func(lns ...I) (c Combinator[I], ln I)

Jump to

Keyboard shortcuts

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