math

package
v1.0.7 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RatioOf100000000  int     = 100_000_000
	RatioOf100000000f float64 = 100_000_000
	RatioOf10000000   int     = 10_000_000
	RatioOf10000000f  float64 = 10_000_000
	RatioOf1000000    int     = 1_000_000
	RatioOf1000000f   float64 = 1_000_000
	RatioOf10000      int     = 10_000
	RatioOf10000f     float64 = 10_000
	RatioOf100        int     = 100
	RatioOf100f       float64 = 100
)

Variables

This section is empty.

Functions

func Fixed

func Fixed(val float64, precision int) float64

func Rand

func Rand() *mrand.Rand

func RandomBetween

func RandomBetween(min, max int) int

func RandomBetweenV2

func RandomBetweenV2(min int, max int) int

func RandomHex

func RandomHex(n int) (string, error)

func RandomString

func RandomString(n int) string

func RandomWheel

func RandomWheel(rate, base float64) bool

func RandomWheelWithBigInt

func RandomWheelWithBigInt(rate, base *big.Int) (bool, error)

func Round

func Round(val float64, precision int) float64

Round 四舍五入,ROUND_HALF_UP 模式实现 返回将 val 根据指定精度 precision(十进制小数点后数字的数目)进行四舍五入的结果。precision 也可以是负数或零。

func Salt

func Salt() *big.Int

Types

This section is empty.

Directories

Path Synopsis
Package decimal implements an arbitrary precision fixed-point decimal.
Package decimal implements an arbitrary precision fixed-point decimal.

Jump to

Keyboard shortcuts

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