Simple question about MPFR vs. GMP

Décio Luiz Gazzoni Filho decio at
Fri Apr 7 19:30:22 CEST 2006

On Apr 7, 2006, at 1:52 PM, Linas Vepstas wrote:

> Hi,
> I have a rather naive question about MPFR vs. GMP that
> I could not resolve by reviewing the MPFR web page. That
> question is this:
>   Exactly HOW is MPFR better than GMP? Why, as a programmer,
>   should I care about exact rounding?
> If I'm writing a program to compute some function to 400
> decimal places, I have to do a fair bit of logic and thinking
> to make sure I actually obtained 400 bits of accuracy. A bit
> of rounding error here and there doesn't substantially change
> my eror estimates .. and so, why should I care about "exact
> rounding"?

The answer to that is very complex. I suggest you grab a book on  
numerical analysis to know how certain simple measures as guard bits/ 
digits and exact rounding help improve the accuracy of computations  
by a lot.

Also consider the fact that, since rounding is not exactly defined,  
results may vary from one version of GMP or architecture to another  
(perhaps even from one compiler to the other). This is how floating  
point used to work in the early days and I heard people weren't very  
pleased with the state of affairs then.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 186 bytes
Desc: This is a digitally signed message part
Url :

More information about the gmp-discuss mailing list