Re: mpz_gcd_ui(NULL, ...) with small limbs

2022-02-08 Thread Marco Bodrato
Ciao Marc, Il 2022-02-08 10:05 Marc Glisse ha scritto: Makes sense to me. I am just not sure if 3 is the right number and if we are consistent about it. Shouldn't 2 be enough? Or is it to be safe You are right. 2 should be enough. I think that if a not realloc-able mpz is used as a target

Re: mpz_gcd_ui(NULL, ...) with small limbs

2022-02-08 Thread Marc Glisse
On Tue, 8 Feb 2022, Marco Bodrato wrote: Ciao Marc, Il 2022-01-22 23:40 Marc Glisse ha scritto: the documentation for mpz_gcd_ui(rop, op1, op2) says "If rop is not NULL, store the result there." and indeed the main code contains two tests "if (w != NULL)". However, mpz_gcd_ui also contains

Re: mpz_gcd_ui(NULL, ...) with small limbs

2022-02-08 Thread Marco Bodrato
Ciao Marc, Il 2022-01-22 23:40 Marc Glisse ha scritto: the documentation for mpz_gcd_ui(rop, op1, op2) says "If rop is not NULL, store the result there." and indeed the main code contains two tests "if (w != NULL)". However, mpz_gcd_ui also contains special code for the case where op2 (an

Re: mpz_gcd_ui(NULL, ...) with small limbs

2022-01-31 Thread Marco Bodrato
Ciao, Il Sab, 22 Gennaio 2022 11:40 pm, Marc Glisse ha scritto: > mpz_gcd_ui also contains special code for the case > where op2 (an unsigned long) does not fit in a limb. And that code calls > mpz_gcd without checking if the first argument is NULL. That probably does > not affect any platform,

mpz_gcd_ui(NULL, ...) with small limbs

2022-01-22 Thread Marc Glisse
Hello, the documentation for mpz_gcd_ui(rop, op1, op2) says "If rop is not NULL, store the result there." and indeed the main code contains two tests "if (w != NULL)". However, mpz_gcd_ui also contains special code for the case where op2 (an unsigned long) does not fit in a limb. And that