math

package
v0.0.0-...-1b2adb6 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Abs

func Abs[T constraints.Float | constraints.Integer](a T) T

Abs 函数用于计算a的绝对值

func Cbrt

func Cbrt[T constraints.Float | constraints.Integer](a T) T

Cbrt 函数用于计算a的立方根

func Ceil

func Ceil[T constraints.Float | constraints.Integer](a, b T) T

Ceil 函数用于计算a除以b的向上取整的结果 参数a和b的类型为T,满足T为浮点型或者整型 返回值为T类型的向上取整的结果

func Dim

func Dim[T constraints.Float | constraints.Integer](a, b T) T

Dim 函数用于计算a和b的最大值

func Floor

func Floor[T constraints.Float | constraints.Integer](a, b T) T

Floor 函数用于计算a除以b的向下取整的结果

func Hypot

func Hypot[T constraints.Float | constraints.Integer](a, b T) T

Hypot 返回Sqrt (p * p q * q),注意避免不必要的上溢和下溢

func IsNaN

func IsNaN[T constraints.Float | constraints.Integer](a T) bool

IsNaN 函数用于判断a是否为NaN 参数a的类型为T,满足T为浮点型或者整型 返回值为bool类型,表示a是否为NaN

func Max

func Max[T constraints.Float | constraints.Integer](a, b T) T

Max 函数用于计算a和b的最大值

func Min

func Min[T constraints.Float | constraints.Integer](a, b T) T

Min 函数用于计算a和b的最小值

func Mod

func Mod[T constraints.Float | constraints.Integer](a, b T) T

Mod 函数用于计算a除以b的余数

func Pow

func Pow[T constraints.Float | constraints.Integer](a, b T) T

Pow 函数用于计算a的b次方

func Round

func Round[T constraints.Float | constraints.Integer](a T) T

Round 函数用于计算a的四舍五入的结果

func Sqrt

func Sqrt[T constraints.Float | constraints.Integer](a T) T

Sqrt 函数用于计算a的平方根

func Trunc

func Trunc(x float64) float64

Trunc 函数用于计算a的向下取整的结果

Types

This section is empty.

Jump to

Keyboard shortcuts

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