Documentation
¶
Index ¶
- Constants
- func ApproximatelyEqual(a, b float64) bool
- func BigIntToHighAndLow(x *big.Int) (uint64, uint64)
- func CantorPair(k1, k2 uint64) uint64
- func CantorUnpair(pair uint64) (uint64, uint64)
- func Clamp(value, lowerLimit, upperLimit float64) float64
- func HighAndLowToBigInt(h, l uint64) *big.Int
- func IntStringToBigInt(str string) *big.Int
- func RandomDigitString(length int) (result string)
- func Round(v float64, p float64) float64
- func RoundWithPrecision(value float64, precision float64) float64
- func WeightIndex(prob map[interface{}]uint64) interface{}
Constants ¶
View Source
const (
DefaultPrecision float64 = 0.0001
)
mathematics constants
Variables ¶
This section is empty.
Functions ¶
func ApproximatelyEqual ¶
ApproximatelyEqual function to test if two real numbers are (almost) equal
func CantorPair ¶
CantorPair two uint64 numbers by cantor pairing function.
func CantorUnpair ¶
CantorUnpair one uint64 pair to two uint64 numbers by cantor pairing function.
func HighAndLowToBigInt ¶
func IntStringToBigInt ¶
func RandomDigitString ¶
RandomDigitString return random digit string
func RoundWithPrecision ¶
RoundWithPrecision round precision
func WeightIndex ¶
func WeightIndex(prob map[interface{}]uint64) interface{}
WeightIndex get key by probability chances
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.