mini-gmp test suite could be improved
paul zimmermann
Paul.Zimmermann at inria.fr
Wed Sep 5 08:08:21 UTC 2018
Hi,
I noticed the mini-gmp test suite does not seem to contain any test of
mpz_add_ui with the unsigned long argument having more than 32 bits.
Indeed with the following change "make check" still says "All 25 tests passed"
(with the mini-gmp from gmp-6.1.2):
void
mpz_add_ui (mpz_t r, const mpz_t a, unsigned long b)
{
b = b % 0xffffffff;
if (a->_mp_size >= 0)
r->_mp_size = mpz_abs_add_ui (r, a, b);
else
r->_mp_size = -mpz_abs_sub_ui (r, a, b);
}
At least one test with ULONG_MAX would be welcome.
Maybe the same holds for other ui/si functions.
Paul
More information about the gmp-devel
mailing list