mini-gmp errors on SYSTYPE: powerpc750-unknown-linux-gnu

Marco Bodrato bodrato at mail.dm.unipi.it
Tue Dec 17 19:03:30 UTC 2019


 From our testing system is emerging an error on some powerpc750.

The test t-cmp_d for mini-gmp is failing with:

mpz_cmp_d wrong (from check_infinity)
   got  1
   want -1
   x=141246703213942603[...]
[...]
   y 3.40282e+38
   y 47 F0 00 00 00 00 00 00

This comes from the following lines in mini-gmp/tests/t-cmp_d.c:

void
check_infinity (void)
{
   mpz_t   x;
   double  y = HUGE_VAL;
   if (y != 2*y)
     return;
[..]
   /* 2^5000 cmp inf */
   mpz_set_ui (x, 1L);
   mpz_mul_2exp (x, x, 5000L);
   check_one ("check_infinity", x,  y, -1, -1);
[..]

So, it seems that on that systems HUGE_VAL is defined as 3.40282e+38.
This probably is the larger value that can be represented, because the 
function does not stop the test after the "if (y != 2*y) return;" check.

But in the function cmp_d, the double value is not multiplied, it is 
divided... maybe if we change the initial test into "if (y != y/2) 
return;", then the test is simply skipped in this case. May this be the 
desired behaviour?

Ĝis,
m


More information about the gmp-devel mailing list