num

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2024 License: MPL-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Abs

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

func Clamp

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

Clamp returns a function which ensures that the input value is within the specified range.

func SameSign

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

SameSign returns true if a and b have the same sign.

Types

type Float

type Float interface{ ~float32 | ~float64 }

type Integer

type Integer interface{ Signed | Unsigned }

type Numeric

type Numeric interface{ Unsigned | Signed | Float }

type Signed

type Signed interface {
	~int | ~int8 | ~int16 | ~int32 | ~int64
}

type Unsigned

type Unsigned interface {
	~uint | ~uint8 | ~uint16 | ~uint32 | ~uint64 | ~uintptr
}

Jump to

Keyboard shortcuts

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