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

Décio Luiz Gazzoni Filho decio at decpp.net
Mon Aug 1 10:11:32 CEST 2005


On Aug 1, 2005, at 5:02 AM, usenett at gmx.de wrote:

>>> I want to write a function of converting mpf_t-variables to  
>>> 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  
> like to
> know 'how' to convert a binary number to a correctly rouned double  
> float to
> implement this directly for the GMP-library without using the  
> 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?

Décio
-------------- 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 : http://gmplib.org/list-archives/gmp-discuss/attachments/20050801/06cdcfd0/PGP.bin


More information about the gmp-discuss mailing list