Re: convert mpf t to double with rounding-modes defined by ieee754

usenett@gmx.de usenett at gmx.de
Mon Aug 1 10:29:20 CEST 2005


> >>> I want to write a function of converting mpf_t-variables to =20
> >>> doubles by a
> >>> given rounding mode (to-nearest, truncation, plus infinity, minus
> >>>
> >> infinity)
> >>
> >>> defined by the IEEE754 standard.
> >>>
> >>
> >> See: http://www.mpfr.org/
> >> Conversion from mpf_t to mpfr_t is very straightforward.
> >>
> >
> > Thanks for the link, but thats not really what I'm looking for. I'd =20=
> 
> > like to
> > know 'how' to convert a binary number to a correctly rouned double =20
> > float to
> > implement this directly for the GMP-library without using the =20
> > inefficient
> > indirection with MPFR.
> >
> > Isn't there any good tutorial how to do such things?
> 
> Why not use mpfr_t throughout, without making any conversions?
> 
> Or are you implying that MPFR is inefficient?

I don't want to say that MPFR is inefficient, I'm far away from this view.
But for my situation (simulating a long accumulator) I prefer GMP, cause
MPFR has a bigger functionality than I need and that makes it slow for my
purpose. The only advantage is the closing rouned double conversion.
Of course later on a comparison between my implementation and MPFR would be
interesting.

Greets, Heinz

-- 
5 GB Mailbox, 50 FreeSMS http://www.gmx.net/de/go/promail
+++ GMX - die erste Adresse für Mail, Message, More +++


More information about the gmp-discuss mailing list