projects
/
ghc-hetmet.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(from parent 1:
fd361be
)
[project @ 1998-02-27 12:08:26 by simonm]
author
simonm
<unknown>
Fri, 27 Feb 1998 12:08:26 +0000
(12:08 +0000)
committer
simonm
<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
patch
|
blob
|
history
diff --git
a/ghc/runtime/gmp/mpz_get_si.c
b/ghc/runtime/gmp/mpz_get_si.c
index
9cddf4b
..
b2b87a7
100644
(file)
--- a/
ghc/runtime/gmp/mpz_get_si.c
+++ b/
ghc/runtime/gmp/mpz_get_si.c
@@
-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;
}