[project @ 1998-02-27 12:08:26 by simonm]
authorsimonm <unknown>
Fri, 27 Feb 1998 12:08:26 +0000 (12:08 +0000)
committersimonm <unknown>
Fri, 27 Feb 1998 12:08:26 +0000 (12:08 +0000)
Fix for the minBound case, obtained from GMP 2.

ghc/runtime/gmp/mpz_get_si.c

index 9cddf4b..b2b87a7 100644 (file)
@@ -34,7 +34,7 @@ mpz_get_si (integer)
   if (size > 0)
     return integer->d[0] % ((mp_limb) 1 << (BITS_PER_MP_LIMB - 1));
   else if (size < 0)
-    return -(integer->d[0] % ((mp_limb) 1 << (BITS_PER_MP_LIMB - 1)));
+    return ~((integer->d[0] - 1) % ((mp_limb) 1 << (BITS_PER_MP_LIMB - 1)));
   else
     return 0;
 }