gmp 4.2.4 - mpf_add two large negative floats - strange result

Vincent Lefevre vincent at vinc17.org
Thu Jan 22 12:09:37 CET 2009


On 2009-01-22 08:49:32 +0100, Paul Zimmermann wrote:
> 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.

Yes, and in MPFR, all numbers are normalized, meaning that the
"real" precision is always equal to the declared precision. On
the accuracy side, MPFR provides correct rounding to the declared
precision, while in GMP, the accuracy is unspecified, AFAIK.

-- 
Vincent Lefèvre <vincent at vinc17.org> - Web: <http://www.vinc17.org/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.org/blog/>
Work: CR INRIA - computer arithmetic / Arenaire project (LIP, ENS-Lyon)


More information about the gmp-discuss mailing list