diff options
author | Sylvain Henry <sylvain@haskus.fr> | 2020-08-24 19:21:53 +0200 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2020-08-26 04:51:35 -0400 |
commit | dc476a5040cdc64c177de0f78edaafec0972cff4 (patch) | |
tree | 7b2c5add9c12472c84d9ff8b13fd95ec2075ae28 /testsuite/tests/numeric | |
parent | 0b17fa185aec793861364afd9a05aa4219fbc019 (diff) | |
download | haskell-dc476a5040cdc64c177de0f78edaafec0972cff4.tar.gz |
Bignum: fix BigNat subtraction (#18604)
There was a confusion between the boolean expected by
withNewWordArrayTrimedMaybe and the boolean returned by subtracting
functions.
Diffstat (limited to 'testsuite/tests/numeric')
-rw-r--r-- | testsuite/tests/numeric/should_run/T18604.hs | 10 | ||||
-rw-r--r-- | testsuite/tests/numeric/should_run/T18604.stdout | 1 | ||||
-rw-r--r-- | testsuite/tests/numeric/should_run/all.T | 1 |
3 files changed, 12 insertions, 0 deletions
diff --git a/testsuite/tests/numeric/should_run/T18604.hs b/testsuite/tests/numeric/should_run/T18604.hs new file mode 100644 index 0000000000..f1538d8585 --- /dev/null +++ b/testsuite/tests/numeric/should_run/T18604.hs @@ -0,0 +1,10 @@ +module Main (main) where + +import Numeric.Natural + +main :: IO () +main = print (n - s) + where + n, s :: Natural + n = 137503105969312982142385040956303729937425409769904987267247644890331944583201 + s = 370814112419299627365008243601943822482 diff --git a/testsuite/tests/numeric/should_run/T18604.stdout b/testsuite/tests/numeric/should_run/T18604.stdout new file mode 100644 index 0000000000..863dc3a6b4 --- /dev/null +++ b/testsuite/tests/numeric/should_run/T18604.stdout @@ -0,0 +1 @@ +137503105969312982142385040956303729937054595657485687639882636646730000760719 diff --git a/testsuite/tests/numeric/should_run/all.T b/testsuite/tests/numeric/should_run/all.T index 3f3cb45dda..74d4f220d4 100644 --- a/testsuite/tests/numeric/should_run/all.T +++ b/testsuite/tests/numeric/should_run/all.T @@ -73,3 +73,4 @@ test('T18359', normal, compile_and_run, ['']) test('T18499', normal, compile_and_run, ['']) test('T18509', normal, compile_and_run, ['']) test('T18515', normal, compile_and_run, ['']) +test('T18604', normal, compile_and_run, ['']) |