Floating point exponentiation
daggillies at gmail.com
Tue Mar 23 09:25:39 CET 2010
What does 'big' mean? Forget floating point: exp(n) for an n that fits
in a uint32_t will exhaust, or as near as makes no difference, memory
in any normal machine. exp(2^32) is around the billion-byte mark in
radix 256 (eight bit binary.) Even if you can fit your operand (and
its destination) in main memory, any computation beyond O(n) is going
to be silly. 64 bit? Nah. The exponent ceases to be representable in a
first-order scheme. The mantissa waved bye-bye through the back window
many miles back.
On Mon, Mar 22, 2010 at 7:01 PM, Chris Gast <cmgast at gmail.com> wrote:
> I'm relatively new to this library, and have encountered a problem for which
> the manual does not appear to provide a solution.
> Is there a way to compute exp(x), where x is a "big" floating point
> My code section is as follows:
> mpf_t expn;
> mpf_t totLbig;
> I would then really like to just do the following:
> mpf_pow_xyz(totLbig, expn, totLbig)
> but it appears that my function mpf_pow_xyz truly is fictitious.
> An alternative would be to approximate the value as totLbig =
> (1+totLbig/n)^n, for a very large unsigned long integer n, but I'd like to
> avoid this extra step, if possible.
> Thanks in advance,
> Chris Gast
> Chris Gast
> cmgast at gmail.com
> gmp-discuss mailing list
> gmp-discuss at gmplib.org
More information about the gmp-discuss