diff options
author | Sylvain Henry <sylvain@haskus.fr> | 2020-09-30 17:43:10 +0200 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2020-10-02 13:52:38 -0400 |
commit | 12c06927a03a2fdb516f7008c57d68568b02b576 (patch) | |
tree | c01860d5708f449e96722e4fa45d5dd992e03d28 /libraries/ghc-bignum/cbits | |
parent | 3c9beab75aaa5fbbb11132c99e2af114f322152f (diff) | |
download | haskell-12c06927a03a2fdb516f7008c57d68568b02b576.tar.gz |
Bignum: implement integerRecipMod (#18427)
Diffstat (limited to 'libraries/ghc-bignum/cbits')
-rw-r--r-- | libraries/ghc-bignum/cbits/gmp_wrappers.c | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/libraries/ghc-bignum/cbits/gmp_wrappers.c b/libraries/ghc-bignum/cbits/gmp_wrappers.c index 56075fd1f7..e036f05a9a 100644 --- a/libraries/ghc-bignum/cbits/gmp_wrappers.c +++ b/libraries/ghc-bignum/cbits/gmp_wrappers.c @@ -779,8 +779,7 @@ integer_gmp_invert(mp_limb_t rp[], // result if (mp_limb_zero_p(xp,xn) || mp_limb_zero_p(mp,mn) || ((mn == 1 || mn == -1) && mp[0] == 1)) { - rp[0] = 0; - return 1; + return 0; } const mpz_t x = CONST_MPZ_INIT(xp, xn); @@ -800,11 +799,6 @@ integer_gmp_invert(mp_limb_t rp[], // result mpz_clear (r); - if (!rn) { - rp[0] = 0; - return 1; - } - return rn; } |