mini-gmp and mpq

Marc Glisse marc.glisse at inria.fr
Tue Feb 27 20:32:45 UTC 2018


On Tue, 27 Feb 2018, Marco Bodrato wrote:

> Il Mar, 27 Febbraio 2018 8:22 pm, Marc Glisse ha scritto:
>> If I write q = 1 + 1 / q, gmpxx currently generates:
>> mpq_inv(q, q);
>> mpz_addmul_ui(num, den, 1);
>>
>> Not quite optimal yet :-(
>
> May the following help?

Something like that, yes. But it feels like this is duplicating 
functionality that should be elsewhere... Bah, I am probably too picky for 
so few lines, feel free to go ahead and commit your patch (I don't 
remember if any of the tests do q+1).

-- 
Marc Glisse


More information about the gmp-devel mailing list