xmath

package
v0.6.0 Latest Latest
Warning

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

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

Documentation

Overview

Package xmath contains extensions to the standard library package math.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Abs

func Abs[T constraints.Signed](x T) T

Abs returns the absolute value of x. It panics if this value is not representable, for example because -math.MinInt32 requires more than 32 bits to represent and so does not fit in an int32.

func Clamp

func Clamp[T constraints.Ordered](x, min, max T) T

Clamp clamps the value of x to within min and max.

func Max

func Max[T constraints.Ordered](a, b T) T

Max returns the maximum of a and b based on the > operator.

func Min

func Min[T constraints.Ordered](a, b T) T

Min returns the minimum of a and b based on the < operator.

Types

This section is empty.

Directories

Path Synopsis
Package xrand contains extensions to the standard library package math/rand.
Package xrand contains extensions to the standard library package math/rand.

Jump to

Keyboard shortcuts

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