Documentation ¶
Index ¶
- func AbsDifferenceWithSign(a, b sdk.Dec) (sdk.Dec, bool)
- func AddMut(a, b sdk.Dec) sdk.Dec
- func Clone(a sdk.Dec) sdk.Dec
- func MulMut(a, b sdk.Dec) sdk.Dec
- func NegMut(a sdk.Dec) sdk.Dec
- func Pow(base sdk.Dec, exp sdk.Dec) sdk.Dec
- func PowApprox(base sdk.Dec, exp sdk.Dec, precision sdk.Dec) sdk.Dec
- func SigFigRound(d sdk.Dec, tenToSigFig sdk.Int) sdk.Dec
- func SubMut(a, b sdk.Dec) sdk.Dec
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AbsDifferenceWithSign ¶
AbsDifferenceWithSign returns | a - b |, (a - b).sign() a is mutated and returned
func Pow ¶
Pow computes base^(exp) However since the exponent is not an integer, we must do an approximation algorithm. TODO: In the future, lets add some optimized routines for common exponents, e.g. for common wIn / wOut ratios Many simple exponents like 2:1 pools
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.