gnum

package
v1.12.22 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Abs

func Abs(number float64) float64

Abs abs(num)返回绝对值,返回结果是float64

func Ceil

func Ceil(value float64) float64

Ceil 产生一个向上取整的数字,php ceil(num)

func Floor

func Floor(value float64) float64

Floor 产生一个向下取整的数字,对应php floor(num)

func IsNumeric

func IsNumeric(v interface{}) bool

IsNumeric 判断v是否是一个数字类型,php is_numeric(num) Numeric strings consist of optional sign, any number of digits, optional decimal part and optional exponential part. Thus +0123.45e6 is a valid numeric value. In PHP hexadecimal (e.g. 0xf4c3b00c) is not supported, but IsNumeric is supported.

func Max

func Max(nums ...float64) float64

Max 获得数字的最大值 max(1,2,3)

func Min

func Min(nums ...float64) float64

Min min(1,2,3)返回最小值

func Rand

func Rand(min, max int) int

Rand 产生[m,n]区间的int随机数 Range: [0, 2147483647]

func RandInt64

func RandInt64(min, max int64) int64

RandInt64 生成m-n之间的随机数

func Round

func Round(f float64, n int) float64

Round 对浮点数进行四舍五入操作比如 12.125保留2位小数==>12.13

Types

This section is empty.

Jump to

Keyboard shortcuts

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