gmp 4.2.4 - mpf_add two large negative floats - strange result

Paul Zimmermann Paul.Zimmermann at loria.fr
Thu Jan 22 08:49:32 CET 2009


> Duh .... 53 bits is the default for mpfr (I think), but the default for 
> gmp's mpf type is 64 (on my build, at least).

right for mpfr. For gmp, the "precision" depends on the value you store. More
precisely, gmp mpf_t's are stored in base 2^32 or 2^64, with at least 64
significant bits. This implies at least 3 words on a 32-bit computer, and
2 words on a 64-bit computer. Thus the "real" precision you get when you
request 53 bits can go from 65 bits for a number like 1.xxx on a 32-bit
computer, to 128 bits for a number like 0.999xxx on a 64-bit computer.

Paul Zimmermann


More information about the gmp-discuss mailing list