mathutil

package
v12.88.0 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2023 License: Apache-2.0 Imports: 1 Imported by: 6

Documentation

Overview

Package mathutil provides some additional math methods

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Abs

func Abs[N NumericNeg](val N) N

Abs returns absolute value

func Abs16 deprecated

func Abs16(val int16) int16

Abs16 returns absolute value

Deprecated: Use method Abs instead

func Abs32 deprecated

func Abs32(val int32) int32

Abs32 returns absolute value

Deprecated: Use method Abs instead

func Abs64 deprecated

func Abs64(val int64) int64

Abs64 returns absolute value

Deprecated: Use method Abs instead

func Abs8 deprecated

func Abs8(val int8) int8

Abs8 returns absolute value

Deprecated: Use method Abs instead

func AbsF deprecated

func AbsF(val float64) float64

AbsF returns absolute value

Deprecated: Use method Abs instead

func AbsF32 deprecated

func AbsF32(val float32) float32

AbsF32 returns absolute value

Deprecated: Use method Abs instead

func AbsF64 deprecated

func AbsF64(val float64) float64

AbsF64 returns absolute value

Deprecated: Use method Abs instead

func Between

func Between[N Numeric](val, min, max N) N

Between returns value between min and max values

func Between16 deprecated

func Between16(val, min, max int16) int16

Between16 returns value between min and max values

Deprecated: Use method Between instead

func Between32 deprecated

func Between32(val, min, max int32) int32

Between32 returns value between min and max values

Deprecated: Use method Between instead

func Between64 deprecated

func Between64(val, min, max int64) int64

Between64 returns value between min and max values

Deprecated: Use method Between instead

func Between8 deprecated

func Between8(val, min, max int8) int8

Between8 returns value between min and max values

Deprecated: Use method Between instead

func BetweenF deprecated

func BetweenF(val, min, max float64) float64

BetweenF returns value between min and max values

Deprecated: Use method Between instead

func BetweenF32 deprecated

func BetweenF32(val, min, max float32) float32

BetweenF32 returns value between min and max values

Deprecated: Use method Between instead

func BetweenF64 deprecated

func BetweenF64(val, min, max float64) float64

BetweenF64 returns value between min and max values

Deprecated: Use method Between instead

func BetweenU deprecated

func BetweenU(val, min, max uint) uint

BetweenU returns value between min and max values

Deprecated: Use method Between instead

func BetweenU16 deprecated

func BetweenU16(val, min, max uint16) uint16

BetweenU16 returns value between min and max values

Deprecated: Use method Between instead

func BetweenU32 deprecated

func BetweenU32(val, min, max uint32) uint32

BetweenU32 returns value between min and max values

Deprecated: Use method Between instead

func BetweenU64 deprecated

func BetweenU64(val, min, max uint64) uint64

BetweenU64 returns value between min and max values

Deprecated: Use method Between instead

func BetweenU8 deprecated

func BetweenU8(val, min, max uint8) uint8

BetweenU8 returns value between min and max values

Deprecated: Use method Between instead

func Max

func Max[N Numeric](val1, val2 N) N

Max returns a greater value

func Max16 deprecated

func Max16(val1, val2 int16) int16

Max16 returns a greater value

Deprecated: Use method Max instead

func Max32 deprecated

func Max32(val1, val2 int32) int32

Max32 returns a greater value

Deprecated: Use method Max instead

func Max64 deprecated

func Max64(val1, val2 int64) int64

Max64 returns a greater value

Deprecated: Use method Max instead

func Max8 deprecated

func Max8(val1, val2 int8) int8

Max8 returns a greater value

Deprecated: Use method Max instead

func MaxU deprecated

func MaxU(val1, val2 uint) uint

MaxU returns a greater value

Deprecated: Use method Max instead

func MaxU16 deprecated

func MaxU16(val1, val2 uint16) uint16

MaxU16 returns a greater value

Deprecated: Use method Max instead

func MaxU32 deprecated

func MaxU32(val1, val2 uint32) uint32

MaxU32 returns a greater value

Deprecated: Use method Max instead

func MaxU64 deprecated

func MaxU64(val1, val2 uint64) uint64

MaxU64 returns a greater value

Deprecated: Use method Max instead

func MaxU8 deprecated

func MaxU8(val1, val2 uint8) uint8

MaxU8 returns a greater value

Deprecated: Use method Max instead

func Min

func Min[N Numeric](val1, val2 N) N

Min returns a smaller value

func Min16 deprecated

func Min16(val1, val2 int16) int16

Min16 returns a smaller value

Deprecated: Use method Min instead

func Min32 deprecated

func Min32(val1, val2 int32) int32

Min32 returns a smaller value

Deprecated: Use method Min instead

func Min64 deprecated

func Min64(val1, val2 int64) int64

Min64 returns a smaller value

Deprecated: Use method Min instead

func Min8 deprecated

func Min8(val1, val2 int8) int8

Min8 returns a smaller value

Deprecated: Use method Min instead

func MinU deprecated

func MinU(val1, val2 uint) uint

MinU returns a smaller value

Deprecated: Use method Min instead

func MinU16 deprecated

func MinU16(val1, val2 uint16) uint16

MinU16 returns a smaller value

Deprecated: Use method Min instead

func MinU32 deprecated

func MinU32(val1, val2 uint32) uint32

MinU32 returns a smaller value

Deprecated: Use method Min instead

func MinU64

func MinU64(val1, val2 uint64) uint64

MinU64 returns a smaller value

func MinU8 deprecated

func MinU8(val1, val2 uint8) uint8

MinU8 returns a smaller value

Deprecated: Use method Min instead

func Round

func Round(v float64, p int) float64

Round returns rounded value

Types

type Numeric added in v12.72.0

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

type NumericNeg added in v12.72.0

type NumericNeg interface {
	~int | ~int8 | ~int16 | ~int32 | ~int64 | ~float32 | ~float64
}

Jump to

Keyboard shortcuts

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