intutil

package
v0.0.0-...-00e7cc2 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2018 License: MIT Imports: 2 Imported by: 3

Documentation

Index

Constants

View Source
const (
	MaxUint = ^uint(0)
	MinUint = 0
	MaxInt  = int(MaxUint >> 1)
	MinInt  = -MaxInt - 1
)

Constants

Variables

This section is empty.

Functions

func Abs

func Abs(a int) int

Abs value of an int

func Int16Max

func Int16Max(in, max int16) int16

Int16Max returns the in value or max whichever is smaller

func Int16Min

func Int16Min(in, min int16) int16

Int16Min returns the in value or min whichever is larger

func Int32Max

func Int32Max(in, max int32) int32

Int32Max returns the in value or max whichever is smaller

func Int32Min

func Int32Min(in, min int32) int32

Int32Min returns the in value or min whichever is larger

func Int64Max

func Int64Max(in, max int64) int64

Int64Max returns the in value or max whichever is smaller

func Int64Min

func Int64Min(in, min int64) int64

Int64Min returns the in value or min whichever is larger

func Int8Max

func Int8Max(in, max int8) int8

Int8Max returns the in value or max whichever is smaller

func Int8Min

func Int8Min(in, min int8) int8

Int8Min returns the in value or min whichever is larger

func Max

func Max(a, b int) int

Max returns the larger of a or b

func Maxv

func Maxv(ints ...int) int

Maxv returns the largest int passed in the variadic argument.

func Min

func Min(a, b int) int

Min returns the smaller of a or b

func Minv

func Minv(ints ...int) int

Minv returns the smallest int passed in the variadic argument.

func Uint16Max

func Uint16Max(in, max uint16) uint16

Uint16Max returns the in value or max whichever is smaller

func Uint16Min

func Uint16Min(in, min uint16) uint16

Uint16Min returns the in value or min whichever is larger

func Uint32Max

func Uint32Max(in, max uint32) uint32

Uint32Max returns the in value or max whichever is smaller

func Uint32Min

func Uint32Min(in, min uint32) uint32

Uint32Min returns the in value or min whichever is larger

func Uint64Max

func Uint64Max(in, max uint64) uint64

Uint64Max returns the in value or max whichever is smaller

func Uint64Min

func Uint64Min(in, min uint64) uint64

Uint64Min returns the in value or min whichever is larger

func Uint8Max

func Uint8Max(in, max uint8) uint8

Uint8Max returns the in value or max whichever is smaller

func Uint8Min

func Uint8Min(in, min uint8) uint8

Uint8Min returns the in value or min whichever is larger

func UintMax

func UintMax(in, max uint) uint

UintMax returns the in value or max whichever is smaller

func UintMin

func UintMin(in, min uint) uint

UintMin returns the in value or min whichever is larger

Types

type Decrementor

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

Decrementor defines a class that allows multiple threads/processes to act upon to decrement a counter

func NewDecrementor

func NewDecrementor(initialMax int64) *Decrementor

NewDecrementor will return a reference to a Decrementor object

func (*Decrementor) Decrement

func (decrementor *Decrementor) Decrement() int

Decrement will decrement by 1 the initial max the class was instantiated with

func (*Decrementor) GetInitialMax

func (decrementor *Decrementor) GetInitialMax() int

GetInitialMax will return the inital maximum value that was set upon instantiation

Jump to

Keyboard shortcuts

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