util

package
v0.0.0-...-8c637cd Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2020 License: MIT Imports: 0 Imported by: 0

Documentation

Overview

Package util provides some basic utility functions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Clamp

func Clamp(min, max, val int) int

Clamp returns val if val is within min and max, min if val < min, or max if val > max. This clamps val to the range defined by min and max.

func MakeRange

func MakeRange(max int64) []int64

MakeRange returns a new array of length max, with contents (0, ..., max - 1)

func Max

func Max(a, b int) int

Max returns the largest of a and b.

func Min

func Min(a, b int) int

Min returns the smallest of a and b.

Types

This section is empty.

Jump to

Keyboard shortcuts

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