math

package
v2.0.4 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2022 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AbsSigned

func AbsSigned[T constraints.Signed](val T) T

AbsSigned returns the absolute value of a signed integer value.

func CompareOrdered

func CompareOrdered[T constraints.Ordered](lhs, rhs T) int

CompareOrdered compares two values satisfying constraints.Ordered and return a value less than, equal to, or greater than zero if lhs is found, respectively, to be less than, to match, or be greater than rhs.

func MaxInteger

func MaxInteger[T constraints.Integer](lhs, rhs T) T

MaxInteger returns the highest of two integer values.

func MinInteger

func MinInteger[T constraints.Integer](lhs, rhs T) T

MinInteger returns the lowest of two integer values.

Types

type Comparator

type Comparator[T any] func(lhs, rhs T) int

Compare two items and return a value less than, equal to, or greater than zero if lhs is found, respectively, to be less than, to match, or be greater than rhs.

Jump to

Keyboard shortcuts

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