I couldn't find anything in the API. Converting the number to a math/big.Int
and back is not an option because the fractional component is significant to my calculation.
I'll end up repeatedly multiplying if there's no API, but that's a dissatisfying solution (math/big.Int.Exp
is just O(log(n))
) which might not be practical when I run into this problem again.
Thanks!
You may use MantExp() to take the exponent of a big.Float
for a particular base/mantissa. Note that the formula for calculating the exponent for a given mantissa is:
x == mant × 2**exp
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With