From 025feb0b44cdf4995d1d773e2ce85d29a679c6c7 Mon Sep 17 00:00:00 2001 From: Roman Date: Tue, 13 Dec 2022 16:38:04 -0800 Subject: [PATCH] export exp2 --- osmomath/exp2.go | 4 ++-- osmomath/export_test.go | 4 ---- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/osmomath/exp2.go b/osmomath/exp2.go index baa278cee2b..d27c08a11a3 100644 --- a/osmomath/exp2.go +++ b/osmomath/exp2.go @@ -33,13 +33,13 @@ var ( maxSupportedExponent = MustNewDecFromStr("2").PowerInteger(9) ) -// exp2 takes 2 to the power of a given non-negative decimal exponent. +// Exp2 takes 2 to the power of a given non-negative decimal exponent. // and returns the result. // The computation is performed by using th following property: // 2^decimal_exp = 2^{integer_exp + fractional_exp} = 2^integer_exp * 2^fractional_exp // The max supported exponent is 2^10. If greater exponent is given, the function panics. // Panics if the exponent is negative. -func exp2(exponent BigDec) BigDec { +func Exp2(exponent BigDec) BigDec { if exponent.Abs().GT(maxSupportedExponent) { panic(fmt.Sprintf("integer exponent %s is too large, max (%s)", exponent, maxSupportedExponent)) } diff --git a/osmomath/export_test.go b/osmomath/export_test.go index a018e369b9f..2331e90dbbe 100644 --- a/osmomath/export_test.go +++ b/osmomath/export_test.go @@ -4,10 +4,6 @@ var ( MaxSupportedExponent = maxSupportedExponent ) -func Exp2(exponent BigDec) BigDec { - return exp2(exponent) -} - func Exp2ChebyshevRationalApprox(exponent BigDec) BigDec { return exp2ChebyshevRationalApprox(exponent) }