mpq_get_d [Was: mini-gmp and mpq]

Marc Glisse marc.glisse at
Sat May 19 08:11:13 UTC 2018

On Tue, 15 May 2018, Marco Bodrato wrote:

> Ciao Marc,
> Il Lun, 19 Febbraio 2018 5:24 pm, Marc Glisse ha scritto:
>> On Mon, 19 Feb 2018, Marco Bodrato wrote:
>>> mpq_get_d currently gives a double, but rounded towards zero...
>> Except when it uses the broken generic code :-(
> If you want, you can check the changed generic code,
> to test if it is less broken...

That looks sensible. I didn't test, I assume it is still broken for 
denormals and infinity (it may be doable using DBL_MAX_EXP, DBL_MIN_EXP, 
DBL_HAS_SUBNORM, etc), but it is already a good improvement if it works 
for normal numbers.

(I never use GMP's get_d functions, they don't quite provide what I need)


Marc Glisse

More information about the gmp-devel mailing list