mathx

package
v0.3.23 Latest Latest
Warning

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

Go to latest
Published: May 9, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Dim

func Dim[N constraints.Integer | constraints.Float](x, y N) N

Dim returns the maximum of x-y or 0.

Parameters:

  • x: The first value
  • y: The second value

Returns:

  • N: The maximum of x-y or 0

func Max

func Max[N constraints.Integer | constraints.Float](x, y N) N

Max returns the maximum of two values.

Parameters:

  • x: The first value
  • y: The second value

Returns:

  • N: The maximum value

func Min

func Min[N constraints.Integer | constraints.Float](x, y N) N

Min returns the minimum of two values.

Parameters:

  • x: The first value
  • y: The second value

Returns:

  • N: The minimum value

func Round

func Round(val float64, precision int64) (newVal float64)

Round rounds the given float64 value to a maximum of the specified number of decimal places.

Parameters:

  • val: The value to round
  • precision: The maximum number of decimal places

Returns:

  • float64: The rounded value

Types

This section is empty.

Jump to

Keyboard shortcuts

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