common

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2024 License: MIT Imports: 3 Imported by: 8

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Abs

func Abs[N Numeric](x N) (zero N)

func Any

func Any[T any](arr []T, f func(T) bool) (ind int, ok bool)

func Clamp

func Clamp[N Numeric](val, lower, upper N) (res N)

func RangeClamp

func RangeClamp[N constraints.Integer](val, a, b N) N

func ReadPipe

func ReadPipe() (res []string)

func SameSign

func SameSign[N Numeric](a, b N) bool

func SmartClamp

func SmartClamp[I constraints.Integer](a, b I) I

Types

type Numeric

type Numeric interface {
	~float32 | ~float64 | ~int | ~int8 | ~int16 | ~int32 | ~int64 | ~uint | ~uint8 | ~uint16 | ~uint32 | ~uint64 | ~uintptr
}

Jump to

Keyboard shortcuts

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