intx

package
v1.9.1 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2021 License: BSD-2-Clause Imports: 1 Imported by: 0

Documentation

Index

Constants

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

Variables

This section is empty.

Functions

func Abs

func Abs(value int) int

Abs return absolute value for int. Note: Abs(MinInt) return MinInt self

func Abs32

func Abs32(value int32) int32

Abs32 return absolute value for int32. Note: Abs(MinInt32) return MinInt32 self

func Abs64

func Abs64(value int64) int64

Abs64 return absolute value for int64. Note: Abs(MinInt64) return MinInt64 self

func Format

func Format(v int) string

Format convert int to str

func Format16

func Format16(v int16) string

Format16 convert int16 to str

func Format32

func Format32(v int32) string

Format32 convert int32 to str

func Format64

func Format64(v int64) string

Format64 convert int64 to str

func Format8

func Format8(v int8) string

Format8 convert int8 to str

func FormatUnsigned

func FormatUnsigned(v uint) string

FormatUnsigned convert uint to str

func FormatUnsigned16

func FormatUnsigned16(v uint16) string

FormatUnsigned16 convert uint16 to str

func FormatUnsigned32

func FormatUnsigned32(v uint32) string

FormatUnsigned32 convert uint32 to str

func FormatUnsigned64

func FormatUnsigned64(v uint64) string

FormatUnsigned64 convert uint64 to str

func FormatUnsigned8

func FormatUnsigned8(v uint8) string

FormatUnsigned8 convert uint8 to str

func Max

func Max(value1, value2 int) int

Max return bigger one of int values

func Max32

func Max32(value1, value2 int32) int32

Max32 return bigger one of int32 values

func Max64

func Max64(value1, value2 int64) int64

Max64 return bigger one of int64 values

func MaxUnsigned

func MaxUnsigned(value1, value2 uint) uint

MaxUnsigned return bigger one of uint values

func MaxUnsigned16

func MaxUnsigned16(value1, value2 uint16) uint16

MaxUnsigned16 return bigger one of uint16 values

func MaxUnsigned32

func MaxUnsigned32(value1, value2 uint32) uint32

MaxUnsigned32 return bigger one of uint32 values

func MaxUnsigned64

func MaxUnsigned64(value1, value2 uint64) uint64

MaxUnsigned64 return bigger one of uint64 values

func Min

func Min(value1, value2 int) int

Min return smaller one of int values

func Min32

func Min32(value1, value2 int32) int32

Min32 return smaller one of int32 values

func Min64

func Min64(value1, value2 int64) int64

Min64 return smaller one of int64 values

func MinUnsigned

func MinUnsigned(value1, value2 uint) uint

MinUnsigned return smaller one of int values

func MinUnsigned16

func MinUnsigned16(value1, value2 uint16) uint16

MinUnsigned16 return smaller one of uint16 values

func MinUnsigned32

func MinUnsigned32(value1, value2 uint32) uint32

MinUnsigned32 return smaller one of uint32 values

func MinUnsigned64

func MinUnsigned64(value1, value2 uint64) uint64

MinUnsigned64 return smaller one of uint64 values

func Parse

func Parse(str string) (int, error)

Parse convert str to int

func Parse16

func Parse16(str string) (int16, error)

Parse16 convert str to int16

func Parse32

func Parse32(str string) (int32, error)

Parse32 convert str to int32

func Parse64

func Parse64(str string) (int64, error)

Parse64 convert str to int64

func Parse8

func Parse8(str string) (int8, error)

Parse8 convert str to int8

func ParseUnsigned

func ParseUnsigned(str string) (uint, error)

ParseUnsigned convert str to uint. if str is not a illegal uint value representation, return defaultValue

func ParseUnsigned16

func ParseUnsigned16(str string) (uint16, error)

ParseUnsigned16 convert str to uint16. if str is not a illegal uint value representation, return defaultValue

func ParseUnsigned32

func ParseUnsigned32(str string) (uint32, error)

ParseUnsigned32 convert str to uint32. if str is not a illegal uint value representation, return defaultValue

func ParseUnsigned64

func ParseUnsigned64(str string) (uint64, error)

ParseUnsigned64 convert str to uint64. if str is not a illegal uint value representation, return defaultValue

func ParseUnsigned8

func ParseUnsigned8(str string) (uint8, error)

ParseUnsigned8 convert str to uint8. if str is not a illegal uint value representation, return defaultValue

func SafeParse

func SafeParse(str string, defaultValue int) int

SafeParse convert str to int. if str is not a illegal int value representation, return defaultValue

func SafeParse16

func SafeParse16(str string, defaultValue int16) int16

SafeParse16 convert str to int16. if str is not a illegal int value representation, return defaultValue

func SafeParse32

func SafeParse32(str string, defaultValue int32) int32

SafeParse32 convert str to int32. if str is not a illegal int value representation, return defaultValue

func SafeParse64

func SafeParse64(str string, defaultValue int64) int64

SafeParse64 convert str to int64. if str is not a illegal int value representation, return defaultValue

func SafeParse8

func SafeParse8(str string, defaultValue int8) int8

SafeParse8 convert str to int8. if str is not a illegal int value representation, return defaultValue

func SafeParseUnsigned

func SafeParseUnsigned(str string, defaultValue uint) uint

SafeParseUnsigned convert str to uint. if str is not a illegal uint value representation, return defaultValue

func SafeParseUnsigned16

func SafeParseUnsigned16(str string, defaultValue uint16) uint16

SafeParseUnsigned16 convert str to uint16. if str is not a illegal uint value representation, return defaultValue

func SafeParseUnsigned32

func SafeParseUnsigned32(str string, defaultValue uint32) uint32

SafeParseUnsigned32 convert str to uint32. if str is not a illegal uint value representation, return defaultValue

func SafeParseUnsigned64

func SafeParseUnsigned64(str string, defaultValue uint64) uint64

SafeParseUnsigned64 convert str to uint64. if str is not a illegal uint value representation, return defaultValue

func SafeParseUnsigned8

func SafeParseUnsigned8(str string, defaultValue uint8) uint8

SafeParseUnsigned8 convert str to uint8. if str is not a illegal uint value representation, return defaultValue

Types

This section is empty.

Jump to

Keyboard shortcuts

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