diff options
author | Sylvain Henry <sylvain@haskus.fr> | 2020-07-28 11:30:44 +0200 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2020-07-29 15:09:02 -0400 |
commit | 96c31ea1f0303ebabc59edccff2e88444fe02722 (patch) | |
tree | b3da29f2cfdd29b1f1e479be215e6478cedb3e82 /testsuite/tests/numeric/should_run | |
parent | e3db4b4c5b7f5d2a62ebd88e174fca07d04c4e18 (diff) | |
download | haskell-96c31ea1f0303ebabc59edccff2e88444fe02722.tar.gz |
Fix bug in Natural multiplication (fix #18509)
A bug was lingering in Natural multiplication (inverting two limbs)
despite QuickCheck tests used during the development leading to wrong
results (independently of the selected backend).
Diffstat (limited to 'testsuite/tests/numeric/should_run')
-rw-r--r-- | testsuite/tests/numeric/should_run/T18509.hs | 6 | ||||
-rw-r--r-- | testsuite/tests/numeric/should_run/T18509.stdout | 2 | ||||
-rw-r--r-- | testsuite/tests/numeric/should_run/all.T | 1 |
3 files changed, 9 insertions, 0 deletions
diff --git a/testsuite/tests/numeric/should_run/T18509.hs b/testsuite/tests/numeric/should_run/T18509.hs new file mode 100644 index 0000000000..fe4df42b14 --- /dev/null +++ b/testsuite/tests/numeric/should_run/T18509.hs @@ -0,0 +1,6 @@ +import Numeric.Natural + +main :: IO () +main = do + print $ (0xFFFFFFFF0 * 0xFFFFFFFF0 :: Natural) + print $ (2 :: Natural) ^ (190 :: Int) diff --git a/testsuite/tests/numeric/should_run/T18509.stdout b/testsuite/tests/numeric/should_run/T18509.stdout new file mode 100644 index 0000000000..4f0e5fd092 --- /dev/null +++ b/testsuite/tests/numeric/should_run/T18509.stdout @@ -0,0 +1,2 @@ +4722366480670621958400 +1569275433846670190958947355801916604025588861116008628224 diff --git a/testsuite/tests/numeric/should_run/all.T b/testsuite/tests/numeric/should_run/all.T index faa4d7c992..f8d6ea3d4d 100644 --- a/testsuite/tests/numeric/should_run/all.T +++ b/testsuite/tests/numeric/should_run/all.T @@ -71,3 +71,4 @@ test('T497', normal, compile_and_run, ['-O']) test('T17303', normal, compile_and_run, ['']) test('T18359', normal, compile_and_run, ['']) test('T18499', normal, compile_and_run, ['']) +test('T18509', normal, compile_and_run, ['']) |