mathutil

package
Version: v0.0.0-...-3a3066c Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2021 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckPercent

func CheckPercent(p int) bool

CheckPercent check if p percent of possiblity succeeded

func GetLittleEndianBytesFromDWord

func GetLittleEndianBytesFromDWord(v int) (b0 byte, b1 byte, b2 byte, b3 byte)

GetLittleEndianBytesFromDWord ...

func GetLittleEndianBytesFromWord

func GetLittleEndianBytesFromWord(v int) (b0 byte, b1 byte)

GetLittleEndianBytesFromWord ...

func HiNibble

func HiNibble(v int) int

HiNibble returns hi nibble

func LoByte

func LoByte(v int) byte

LoByte returns lo byte

func LoNibble

func LoNibble(v int) int

LoNibble returns lo nibble

func MakeByte

func MakeByte(hi int, lo int) byte

MakeByte returns a new byte (hi + lo)

func MakeDWordFromLittleEndianBytes

func MakeDWordFromLittleEndianBytes(b0 byte, b1 byte, b2 byte, b3 byte) int

MakeDWordFromLittleEndianBytes ...

func MakeWordFromLittleEndianBytes

func MakeWordFromLittleEndianBytes(b0 byte, b1 byte) int

MakeWordFromLittleEndianBytes ...

func Max2

func Max2(v0 int, v1 int) int

Max2 returns maximum between 2 values

func Max3

func Max3(v0 int, v1 int, v2 int) int

Max3 returns maximum between 3 values

func Max4

func Max4(v0 int, v1 int, v2 int, v3 int) int

Max4 returns maximum between 4 values

func Min2

func Min2(v0 int, v1 int) int

Min2 returns minimum between 2 values

func Min3

func Min3(v0 int, v1 int, v2 int) int

Min3 returns minimum between 3 values

func Min4

func Min4(v0 int, v1 int, v2 int, v3 int) int

Min4 returns minimum between 4 values

func Min5

func Min5(v0 int, v1 int, v2 int, v3 int, v4 int) int

Min5 returns minimum between 5 values

func PickEqually

func PickEqually(strMap map[string]interface{}) string

PickEqually picks one from vector

func PickStringEqually

func PickStringEqually(strVec []string) string

PickStringEqually picks one from vector

func RandByte

func RandByte(v byte) byte

RandByte returns [0, v)

func RandInt

func RandInt(v int) int

RandInt returns [0, v)

func RandInt2

func RandInt2(low int, high int) int

RandInt2 returns [high, low)

func RandSeed

func RandSeed(seed int64)

RandSeed seeds

func TernaryOpInt

func TernaryOpInt(b bool, trueV int, falseV int) int

TernaryOpInt is a external wrapper for ternaryOpInt

func TernaryOpString

func TernaryOpString(b bool, trueV string, falseV string) string

TernaryOpString is a external wrapper for ternaryOpString

func XAbs

func XAbs(v int) int

XAbs returns |v|

func XCeil

func XCeil(v int, l int) int

XCeil returns a value upper bounded by l

func XClamp

func XClamp(v int, mi int, ma int) int

XClamp returns a value bounded with mi and ma

func XFloor

func XFloor(v int, l int) int

XFloor returns a value lower bounded by l

Types

This section is empty.

Jump to

Keyboard shortcuts

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