mpz_prevprime

Marco Bodrato bodrato at mail.dm.unipi.it
Sat Oct 3 09:40:48 UTC 2020


Ciao,

Il 2020-10-03 03:58 Seth Troisi ha scritto:
>> On Thu, Mar 26, 2020 at 2:00 PM Marco Bodrato
>> Il 2020-03-25 02:25 Seth Troisi ha scritto:
>> + t = diff > 0 ? ((t + 1) | (t > 1)) :
>> + ((t == 3) ? 2 : ((t - 2) | 1));
>> 
>> Maybe move this to the caller side? Or partially, leaving here just
>> ASSERT (t >= 2);
>> t |= (t != 2);
>> 
>> I moved this to the caller side (so that both findnext and

Really? :-) But it's ok anyway.

>> I would also check many gaps around 2^{16n}, to check if everything
>> works correctly when the search crosses the limb boundaries.
>> Maybe structuring the test with a table {"number(base16?)", gap},
>> i.e.
>> with (also) something like:
>> {"65521", 16},
>> {"4294967291", 20},
>> {"281474976710597", 80},
>> {"18446744073709551557", 72},
>> {"1208925819614629174706111", 78},
>> {"79228162514264337593543950319", 78},
>> {"5192296858534827628530496329220021", 100},
>> {"340282366920938463463374607431768211297", 210},
>> 
>> I did this (using hex form) I threw in some 16*n-1 also

I'd really add some more tests around boundaries... for both next and 
prec.

Ĝis,
m


More information about the gmp-devel mailing list