moremath

package
v0.0.0-...-e2c65c2 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2018 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClampInt32

func ClampInt32(n int) uint32

ClampInt32 maps an int into a uint32 ranging from min-int32 to max-int32; anything outside that range is clamped to the extreme it surpassed.

func IntSign

func IntSign(n int) int

IntSign returns -1, 1, or 0 if n is less than, greater than, or equal to 0 respectively.

func MaxInt

func MaxInt(ints ...int) int

MaxInt returns the largest int from its arguments; panics if called with no args.

func MinInt

func MinInt(ints ...int) int

MinInt returns the smallest int from its arguments; panics if called with no args.

func Round

func Round(x float64) float64

Round ala https://www.cockroachlabs.com/blog/rounding-implementations-in-go/

NOTE: obsolete in Go 1.10 when this finally comes into the "math" package.

func Shuffle

func Shuffle(x, y uint32) (z uint64)

Shuffle interleaves two 32 bit integers into a single 64-bit one; can be used to map 2d points to 1d on a z-order curve.

Types

This section is empty.

Jump to

Keyboard shortcuts

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