convert mpf t to double with rounding-modes defined by ieee754 usenett at
Fri Jul 29 17:23:35 CEST 2005


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.

Actually the mpf_get_d-method takes the (max.) two most significand limbs
and adds both to get the double-value. So after getting the first 53
significand bits of the mantissa, a simple truncation takes place. Possibly
existing lower sticky bits are not considered.

Has anyone a good description of an algorithm, how to determine the correct
corresponding double-value from a mpf_t-variable (resp. from a given binary
sequence) for the various rounding-modes? Or has possibly anyone already
done such a work for mpf_t?


GMX DSL = Maximale Leistung zum minimalen Preis!
2000 MB nur 2,99, Flatrate ab 4,99 Euro/Monat:

More information about the gmp-discuss mailing list