Versions in this module Expand all Collapse all v9 v9.0.0 Jun 1, 2022 Changes in this version + const DecimalPrecisionBits + const Precision + var ErrEmptyDecimalStr = errors.New("decimal string cannot be empty") + var ErrInvalidDecimalLength = errors.New("invalid decimal length") + var ErrInvalidDecimalStr = errors.New("invalid decimal string") + var MaxSortableDec = OneDec().Quo(SmallestDec()) + func AbsDifferenceWithSign(a, b sdk.Dec) (sdk.Dec, bool) + func DecApproxEq(t *testing.T, d1 BigDec, d2 BigDec, tol BigDec) (*testing.T, bool, string, string, string) + func DecEq(t *testing.T, exp, got BigDec) (*testing.T, bool, string, string, string) + func DecsEqual(d1s, d2s []BigDec) bool + func GetPowPrecision() sdk.Dec + func IntEq(t *testing.T, exp, got BigInt) (*testing.T, bool, string, string, string) + func Pow(base sdk.Dec, exp sdk.Dec) sdk.Dec + func PowApprox(base sdk.Dec, exp sdk.Dec, precision sdk.Dec) sdk.Dec + func SortableDecBytes(dec BigDec) []byte + func ValidSortableDec(dec BigDec) bool + type BigDec struct + func MaxDec(d1, d2 BigDec) BigDec + func MinDec(d1, d2 BigDec) BigDec + func MustNewDecFromStr(s string) BigDec + func NewBigDec(i int64) BigDec + func NewDecFromBigInt(i *big.Int) BigDec + func NewDecFromBigIntWithPrec(i *big.Int, prec int64) BigDec + func NewDecFromInt(i BigInt) BigDec + func NewDecFromIntWithPrec(i BigInt, prec int64) BigDec + func NewDecFromStr(str string) (BigDec, error) + func NewDecWithPrec(i, prec int64) BigDec + func OneDec() BigDec + func SmallestDec() BigDec + func ZeroDec() BigDec + func (d *BigDec) MarshalTo(data []byte) (n int, err error) + func (d *BigDec) Size() int + func (d *BigDec) Unmarshal(data []byte) error + func (d *BigDec) UnmarshalAmino(bz []byte) error + func (d *BigDec) UnmarshalJSON(bz []byte) error + func (d BigDec) Abs() BigDec + func (d BigDec) Add(d2 BigDec) BigDec + func (d BigDec) ApproxRoot(root uint64) (guess BigDec, err error) + func (d BigDec) ApproxSqrt() (BigDec, error) + func (d BigDec) BigInt() *big.Int + func (d BigDec) Ceil() BigDec + func (d BigDec) Equal(d2 BigDec) bool + func (d BigDec) Float64() (float64, error) + func (d BigDec) Format(s fmt.State, verb rune) + func (d BigDec) GT(d2 BigDec) bool + func (d BigDec) GTE(d2 BigDec) bool + func (d BigDec) IsInteger() bool + func (d BigDec) IsNegative() bool + func (d BigDec) IsNil() bool + func (d BigDec) IsPositive() bool + func (d BigDec) IsZero() bool + func (d BigDec) LT(d2 BigDec) bool + func (d BigDec) LTE(d2 BigDec) bool + func (d BigDec) Marshal() ([]byte, error) + func (d BigDec) MarshalAmino() ([]byte, error) + func (d BigDec) MarshalJSON() ([]byte, error) + func (d BigDec) MarshalYAML() (interface{}, error) + func (d BigDec) Mul(d2 BigDec) BigDec + func (d BigDec) MulInt(i BigInt) BigDec + func (d BigDec) MulInt64(i int64) BigDec + func (d BigDec) MulTruncate(d2 BigDec) BigDec + func (d BigDec) MustFloat64() float64 + func (d BigDec) Neg() BigDec + func (d BigDec) Power(power uint64) BigDec + func (d BigDec) Quo(d2 BigDec) BigDec + func (d BigDec) QuoInt(i BigInt) BigDec + func (d BigDec) QuoInt64(i int64) BigDec + func (d BigDec) QuoRoundUp(d2 BigDec) BigDec + func (d BigDec) QuoTruncate(d2 BigDec) BigDec + func (d BigDec) RoundInt() BigInt + func (d BigDec) RoundInt64() int64 + func (d BigDec) String() string + func (d BigDec) Sub(d2 BigDec) BigDec + func (d BigDec) TruncateDec() BigDec + func (d BigDec) TruncateInt() BigInt + func (d BigDec) TruncateInt64() int64 + type BigInt struct + func MaxInt(i, i2 BigInt) BigInt + func MinInt(i1, i2 BigInt) BigInt + func NewInt(n int64) BigInt + func NewIntFromBigInt(i *big.Int) BigInt + func NewIntFromString(s string) (res BigInt, ok bool) + func NewIntFromUint64(n uint64) BigInt + func NewIntWithDecimal(n int64, dec int) BigInt + func OneInt() BigInt + func ZeroInt() BigInt + func (i *BigInt) MarshalTo(data []byte) (n int, err error) + func (i *BigInt) Size() int + func (i *BigInt) Unmarshal(data []byte) error + func (i *BigInt) UnmarshalAmino(bz []byte) error + func (i *BigInt) UnmarshalJSON(bz []byte) error + func (i BigInt) Abs() BigInt + func (i BigInt) Add(i2 BigInt) (res BigInt) + func (i BigInt) AddRaw(i2 int64) BigInt + func (i BigInt) BigInt() *big.Int + func (i BigInt) Equal(i2 BigInt) bool + func (i BigInt) GT(i2 BigInt) bool + func (i BigInt) GTE(i2 BigInt) bool + func (i BigInt) Int64() int64 + func (i BigInt) IsInt64() bool + func (i BigInt) IsNegative() bool + func (i BigInt) IsNil() bool + func (i BigInt) IsPositive() bool + func (i BigInt) IsUint64() bool + func (i BigInt) IsZero() bool + func (i BigInt) LT(i2 BigInt) bool + func (i BigInt) LTE(i2 BigInt) bool + func (i BigInt) Marshal() ([]byte, error) + func (i BigInt) MarshalAmino() ([]byte, error) + func (i BigInt) MarshalJSON() ([]byte, error) + func (i BigInt) MarshalYAML() (interface{}, error) + func (i BigInt) Mod(i2 BigInt) BigInt + func (i BigInt) ModRaw(i2 int64) BigInt + func (i BigInt) Mul(i2 BigInt) (res BigInt) + func (i BigInt) MulRaw(i2 int64) BigInt + func (i BigInt) Neg() (res BigInt) + func (i BigInt) Quo(i2 BigInt) (res BigInt) + func (i BigInt) QuoRaw(i2 int64) BigInt + func (i BigInt) Sign() int + func (i BigInt) String() string + func (i BigInt) Sub(i2 BigInt) (res BigInt) + func (i BigInt) SubRaw(i2 int64) BigInt + func (i BigInt) ToDec() BigDec + func (i BigInt) Uint64() uint64 Other modules containing this package github.com/osmosis-labs/osmosis/osmomath github.com/osmosis-labs/osmosis/v10 github.com/osmosis-labs/osmosis/v11 github.com/osmosis-labs/osmosis/v12 github.com/osmosis-labs/osmosis/v13 github.com/osmosis-labs/osmosis/v6 github.com/osmosis-labs/osmosis/v7 github.com/osmosis-labs/osmosis/v8