fmath

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2024 License: BSD-3-Clause Imports: 1 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Abs

func Abs(val int64) int64

func CombineInt32

func CombineInt32(high, low int32) int64

Combines two int32 values into a single int64 high occupies bits 32-63 low occupies bits 0-31

func HighInt32

func HighInt32(whole int64) int32

Returns the highest 32 bits of an int64

func LowInt32

func LowInt32(whole int64) int32

Returns the lowest 32 bits of an int64

func Max

func Max(x, y int64) int64

Returns x if x > y, otherwise returns y

NB: Only valid if math.MinInt64 <= x-y <= math.MaxInt64 In particular, always valid if both arguments are positive

func Min

func Min(x, y int64) int64

Returns x if x < y, otherwise returns y

NB: Only valid if math.MinInt64 <= x-y <= math.MaxInt64 In particular, always valid if both arguments are positive

func NxtPowerOfTwo

func NxtPowerOfTwo(val int64) int64

Returns the smallest power of two >= val

func PowerOfTwo

func PowerOfTwo(val int64) bool

Returns true if val is a power of two, otherwise returns false

func UI8GT

func UI8GT(x, y uint8) uint8

Returns 1 if x > y, 0 otherwise

func UI8GTE

func UI8GTE(x, y uint8) uint8

Returns 1 if x >= y, 0 otherwise

func UI8LT

func UI8LT(x, y uint8) uint8

Returns 1 if x < y, 0 otherwise

func UI8LTE

func UI8LTE(x, y uint8) uint8

Returns 1 if x <= y, 0 otherwise

func UI8Not

func UI8Not(x uint8) uint8

Returns 1 if x == 0 Returns 0 if x == 1 Undfined for all other inputs

func UIGT

func UIGT(x, y uint64) uint8

Returns 1 if x > y, 0 otherwise

func UIGTE

func UIGTE(x, y uint64) uint8

Returns 1 if x >= y, 0 otherwise

func UILT

func UILT(x, y uint64) uint8

Returns 1 if x < y, 0 otherwise

func UILTE

func UILTE(x, y uint64) uint8

Returns 1 if x <= y, 0 otherwise

func UINot

func UINot(x uint64) uint8

Returns 1 if x == 0 Returns 0 if x == 1 Undfined for all other inputs

Types

This section is empty.

Jump to

Keyboard shortcuts

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