summaryrefslogtreecommitdiffstats
path: root/Lib/test/decimaltestdata/subtract.decTest
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/decimaltestdata/subtract.decTest')
-rw-r--r--Lib/test/decimaltestdata/subtract.decTest36
1 files changed, 23 insertions, 13 deletions
diff --git a/Lib/test/decimaltestdata/subtract.decTest b/Lib/test/decimaltestdata/subtract.decTest
index bdedc5b..338a09c 100644
--- a/Lib/test/decimaltestdata/subtract.decTest
+++ b/Lib/test/decimaltestdata/subtract.decTest
@@ -1,6 +1,6 @@
------------------------------------------------------------------------
-- subtract.decTest -- decimal subtraction --
--- Copyright (c) IBM Corporation, 1981, 2004. All rights reserved. --
+-- Copyright (c) IBM Corporation, 1981, 2007. All rights reserved. --
------------------------------------------------------------------------
-- Please see the document "General Decimal Arithmetic Testcases" --
-- at http://www2.hursley.ibm.com/decimal for the description of --
@@ -17,7 +17,7 @@
-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
-- mfc@uk.ibm.com --
------------------------------------------------------------------------
-version: 2.39
+version: 2.56
extended: 1
precision: 9
@@ -805,9 +805,9 @@ subx1014 subtract 0 0.01E-999 -> -1E-1001 Subnormal
subx1015 subtract 0 0.999E-999 -> -1.00E-999 Inexact Rounded Subnormal Underflow
subx1016 subtract 0 0.099E-999 -> -1.0E-1000 Inexact Rounded Subnormal Underflow
subx1017 subtract 0 0.009E-999 -> -1E-1001 Inexact Rounded Subnormal Underflow
-subx1018 subtract 0 0.001E-999 -> -0E-1001 Inexact Rounded Subnormal Underflow
-subx1019 subtract 0 0.0009E-999 -> -0E-1001 Inexact Rounded Subnormal Underflow
-subx1020 subtract 0 0.0001E-999 -> -0E-1001 Inexact Rounded Subnormal Underflow
+subx1018 subtract 0 0.001E-999 -> -0E-1001 Inexact Rounded Subnormal Underflow Clamped
+subx1019 subtract 0 0.0009E-999 -> -0E-1001 Inexact Rounded Subnormal Underflow Clamped
+subx1020 subtract 0 0.0001E-999 -> -0E-1001 Inexact Rounded Subnormal Underflow Clamped
subx1030 subtract 0 -1.00E-999 -> 1.00E-999
subx1031 subtract 0 -0.1E-999 -> 1E-1000 Subnormal
@@ -818,9 +818,9 @@ subx1034 subtract 0 -0.01E-999 -> 1E-1001 Subnormal
subx1035 subtract 0 -0.999E-999 -> 1.00E-999 Inexact Rounded Subnormal Underflow
subx1036 subtract 0 -0.099E-999 -> 1.0E-1000 Inexact Rounded Subnormal Underflow
subx1037 subtract 0 -0.009E-999 -> 1E-1001 Inexact Rounded Subnormal Underflow
-subx1038 subtract 0 -0.001E-999 -> 0E-1001 Inexact Rounded Subnormal Underflow
-subx1039 subtract 0 -0.0009E-999 -> 0E-1001 Inexact Rounded Subnormal Underflow
-subx1040 subtract 0 -0.0001E-999 -> 0E-1001 Inexact Rounded Subnormal Underflow
+subx1038 subtract 0 -0.001E-999 -> 0E-1001 Inexact Rounded Subnormal Underflow Clamped
+subx1039 subtract 0 -0.0009E-999 -> 0E-1001 Inexact Rounded Subnormal Underflow Clamped
+subx1040 subtract 0 -0.0001E-999 -> 0E-1001 Inexact Rounded Subnormal Underflow Clamped
-- some non-zero subnormal subtracts
-- subx1056 is a tricky case
@@ -831,7 +831,7 @@ subx1052 subtract 0.10E-999 0.1E-999 -> 0E-1001
subx1053 subtract 0.100E-999 0.1E-999 -> 0E-1001 Clamped
subx1054 subtract 0.01E-999 0.1E-999 -> -9E-1001 Subnormal
subx1055 subtract 0.999E-999 0.1E-999 -> 9.0E-1000 Inexact Rounded Subnormal Underflow
-subx1056 subtract 0.099E-999 0.1E-999 -> -0E-1001 Inexact Rounded Subnormal Underflow
+subx1056 subtract 0.099E-999 0.1E-999 -> -0E-1001 Inexact Rounded Subnormal Underflow Clamped
subx1057 subtract 0.009E-999 0.1E-999 -> -9E-1001 Inexact Rounded Subnormal Underflow
subx1058 subtract 0.001E-999 0.1E-999 -> -1.0E-1000 Inexact Rounded Subnormal Underflow
subx1059 subtract 0.0009E-999 0.1E-999 -> -1.0E-1000 Inexact Rounded Subnormal Underflow
@@ -849,15 +849,25 @@ subx1104 subtract 1.52444E-80 0 -> 1.524E-80 Inexact Rounded Subnormal Underfl
subx1105 subtract 1.52445E-80 0 -> 1.524E-80 Inexact Rounded Subnormal Underflow
subx1106 subtract 1.52446E-80 0 -> 1.524E-80 Inexact Rounded Subnormal Underflow
-subx1111 subtract 1.2345678E-80 1.2345671E-80 -> 0E-83 Inexact Rounded Subnormal Underflow
-subx1112 subtract 1.2345678E-80 1.2345618E-80 -> 0E-83 Inexact Rounded Subnormal Underflow
-subx1113 subtract 1.2345678E-80 1.2345178E-80 -> 0E-83 Inexact Rounded Subnormal Underflow
-subx1114 subtract 1.2345678E-80 1.2341678E-80 -> 0E-83 Inexact Rounded Subnormal Underflow
+subx1111 subtract 1.2345678E-80 1.2345671E-80 -> 0E-83 Inexact Rounded Subnormal Underflow Clamped
+subx1112 subtract 1.2345678E-80 1.2345618E-80 -> 0E-83 Inexact Rounded Subnormal Underflow Clamped
+subx1113 subtract 1.2345678E-80 1.2345178E-80 -> 0E-83 Inexact Rounded Subnormal Underflow Clamped
+subx1114 subtract 1.2345678E-80 1.2341678E-80 -> 0E-83 Inexact Rounded Subnormal Underflow Clamped
subx1115 subtract 1.2345678E-80 1.2315678E-80 -> 3E-83 Rounded Subnormal
subx1116 subtract 1.2345678E-80 1.2145678E-80 -> 2.0E-82 Rounded Subnormal
subx1117 subtract 1.2345678E-80 1.1345678E-80 -> 1.00E-81 Rounded Subnormal
subx1118 subtract 1.2345678E-80 0.2345678E-80 -> 1.000E-80 Rounded Subnormal
+precision: 34
+rounding: half_up
+maxExponent: 6144
+minExponent: -6143
+-- Examples from SQL proposal (Krishna Kulkarni)
+subx1125 subtract 130E-2 120E-2 -> 0.10
+subx1126 subtract 130E-2 12E-1 -> 0.10
+subx1127 subtract 130E-2 1E0 -> 0.30
+subx1128 subtract 1E2 1E4 -> -9.9E+3
+
-- Null tests
subx9990 subtract 10 # -> NaN Invalid_operation
subx9991 subtract # 10 -> NaN Invalid_operation