diff options
author | Sylvain Henry <sylvain@haskus.fr> | 2020-09-24 11:33:33 +0200 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2020-09-25 21:14:36 -0400 |
commit | 04bc50b3c8e40387a0d0f090ea23cd68923f1834 (patch) | |
tree | 56eac59646066c462ef8e3e3dfa92d3e4a0b2ad9 /libraries/integer-gmp | |
parent | 92daad241bf136a10346ecbf520d62921c82bf7d (diff) | |
download | haskell-04bc50b3c8e40387a0d0f090ea23cd68923f1834.tar.gz |
Bignum: implement extended GCD (#18427)
Diffstat (limited to 'libraries/integer-gmp')
-rw-r--r-- | libraries/integer-gmp/src/GHC/Integer/GMP/Internals.hs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/libraries/integer-gmp/src/GHC/Integer/GMP/Internals.hs b/libraries/integer-gmp/src/GHC/Integer/GMP/Internals.hs index e414846d96..3d5fabe6c0 100644 --- a/libraries/integer-gmp/src/GHC/Integer/GMP/Internals.hs +++ b/libraries/integer-gmp/src/GHC/Integer/GMP/Internals.hs @@ -29,6 +29,7 @@ module GHC.Integer.GMP.Internals -- ** Additional 'Integer' operations , gcdInteger + , gcdExtInteger , lcmInteger , sqrInteger @@ -170,6 +171,12 @@ isValidInteger# = I.integerCheck# gcdInteger :: Integer -> Integer -> Integer gcdInteger = I.integerGcd +{-# DEPRECATED gcdExtInteger "Use integerGcde instead" #-} +gcdExtInteger :: Integer -> Integer -> (# Integer, Integer #) +gcdExtInteger a b = case I.integerGcde# a b of + (# g, s, _t #) -> (# g, s #) + + {-# DEPRECATED lcmInteger "Use integerLcm instead" #-} lcmInteger :: Integer -> Integer -> Integer lcmInteger = I.integerLcm |