Performance mpz_divexact / mpz_divexact_ui

Marco Bodrato bodrato at mail.dm.unipi.it
Sun Jan 16 21:52:23 CET 2022


Ciao,

Il Dom, 16 Gennaio 2022 9:21 pm, Paul Zimmermann ha scritto:
>> * Do you have any other suggestions on improving the code shown above?
>
> I would first compute the 2-valuation using mpz_scan1 for example, and
> then try to divide by 5^k, with k bounded by the 2-valuation.

Even if there isn't an _ui variant, I'd consider using mpz_remove.

Ĝis,
m



More information about the gmp-discuss mailing list