mini-gmp and mpq

Marco Bodrato bodrato at
Wed Feb 28 19:06:57 UTC 2018


Il Mar, 27 Febbraio 2018 9:32 pm, Marc Glisse ha scritto:
> 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 :-(

> 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

Pushed it.

> remember if any of the tests do q+1).

I hope I added them with another patch:

In the meanwhile I also pushed some small shortcuts for __gmp_binary_equal
applied to mpq and integers:



More information about the gmp-devel mailing list