some basic questions

Linas Vepstas linas at austin.ibm.com
Thu Dec 21 20:52:15 CET 2006


On Thu, Dec 21, 2006 at 02:17:56PM -0200, Dr. Ing. Carlos López wrote:
> To clarify a little bit: I am looking for something like "... a GMP real
> is represented with a mantissa of NMANT bits and an exponent of NEXP bits,
> being NMANT user defined, and NEXP defined at compile time..."

The number of bits in the mantissa may be set with mpf_set_default_prec().

If you set the number of binary bits to more than a few million,
you might find the performance of a multiply to be unacceptably slow.

I've used mantissa with up to 100K decimal places with acceptable
performance.

> I am looking for the Overflow
> Level (largest finite and positive representable number), the Underflow level
> (i.e. smallest positive, non zero representable number), etc. all of them
> as functions of the (yet unkown to me) user defined parameters (like NMANT,
> NEXP, etc.)

I beleive NEXP is a signed 32-bit int, so that the largest exponent 
is 2^31, and this is independent of the number bits in the mantissa. 
Thus, the smallest and largest representable numbers are

2^{-2^31} and 2^{2^31}

--linas


More information about the gmp-discuss mailing list