annotate Lib/test/decimaltestdata/abs.decTest @ 54294:dba767bc3155 legacy-trunk

remove mention of old ctypes version
author Benjamin Peterson <benjamin@python.org>
date Sat, 23 May 2009 20:59:09 +0000
parents b3901c5660f7
children 670caa9775f6
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
32451
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
1 ------------------------------------------------------------------------
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
2 -- abs.decTest -- decimal absolute value --
48595
b3901c5660f7 Merged revisions 65257 via svnmerge from
Benjamin Peterson <benjamin@python.org>
parents: 44025
diff changeset
3 -- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
32451
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
4 ------------------------------------------------------------------------
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
5 -- Please see the document "General Decimal Arithmetic Testcases" --
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
6 -- at http://www2.hursley.ibm.com/decimal for the description of --
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
7 -- these testcases. --
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
8 -- --
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
9 -- These testcases are experimental ('beta' versions), and they --
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
10 -- may contain errors. They are offered on an as-is basis. In --
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
11 -- particular, achieving the same results as the tests here is not --
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
12 -- a guarantee that an implementation complies with any Standard --
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
13 -- or specification. The tests are not exhaustive. --
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
14 -- --
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
15 -- Please send comments, suggestions, and corrections to the author: --
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
16 -- Mike Cowlishaw, IBM Fellow --
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
17 -- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
18 -- mfc@uk.ibm.com --
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
19 ------------------------------------------------------------------------
48595
b3901c5660f7 Merged revisions 65257 via svnmerge from
Benjamin Peterson <benjamin@python.org>
parents: 44025
diff changeset
20 version: 2.58
32451
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
21
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
22 -- This set of tests primarily tests the existence of the operator.
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
23 -- Additon, subtraction, rounding, and more overflows are tested
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
24 -- elsewhere.
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
25
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
26 precision: 9
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
27 rounding: half_up
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
28 maxExponent: 384
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
29 minexponent: -383
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
30 extended: 1
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
31
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
32 absx001 abs '1' -> '1'
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
33 absx002 abs '-1' -> '1'
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
34 absx003 abs '1.00' -> '1.00'
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
35 absx004 abs '-1.00' -> '1.00'
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
36 absx005 abs '0' -> '0'
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
37 absx006 abs '0.00' -> '0.00'
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
38 absx007 abs '00.0' -> '0.0'
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
39 absx008 abs '00.00' -> '0.00'
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
40 absx009 abs '00' -> '0'
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
41
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
42 absx010 abs '-2' -> '2'
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
43 absx011 abs '2' -> '2'
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
44 absx012 abs '-2.00' -> '2.00'
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
45 absx013 abs '2.00' -> '2.00'
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
46 absx014 abs '-0' -> '0'
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
47 absx015 abs '-0.00' -> '0.00'
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
48 absx016 abs '-00.0' -> '0.0'
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
49 absx017 abs '-00.00' -> '0.00'
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
50 absx018 abs '-00' -> '0'
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
51
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
52 absx020 abs '-2000000' -> '2000000'
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
53 absx021 abs '2000000' -> '2000000'
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
54 precision: 7
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
55 absx022 abs '-2000000' -> '2000000'
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
56 absx023 abs '2000000' -> '2000000'
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
57 precision: 6
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
58 absx024 abs '-2000000' -> '2.00000E+6' Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
59 absx025 abs '2000000' -> '2.00000E+6' Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
60 precision: 3
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
61 absx026 abs '-2000000' -> '2.00E+6' Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
62 absx027 abs '2000000' -> '2.00E+6' Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
63
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
64 absx030 abs '+0.1' -> '0.1'
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
65 absx031 abs '-0.1' -> '0.1'
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
66 absx032 abs '+0.01' -> '0.01'
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
67 absx033 abs '-0.01' -> '0.01'
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
68 absx034 abs '+0.001' -> '0.001'
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
69 absx035 abs '-0.001' -> '0.001'
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
70 absx036 abs '+0.000001' -> '0.000001'
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
71 absx037 abs '-0.000001' -> '0.000001'
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
72 absx038 abs '+0.000000000001' -> '1E-12'
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
73 absx039 abs '-0.000000000001' -> '1E-12'
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
74
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
75 -- examples from decArith
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
76 precision: 9
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
77 absx040 abs '2.1' -> '2.1'
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
78 absx041 abs '-100' -> '100'
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
79 absx042 abs '101.5' -> '101.5'
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
80 absx043 abs '-101.5' -> '101.5'
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
81
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
82 -- more fixed, potential LHS swaps/overlays if done by subtract 0
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
83 precision: 9
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
84 absx060 abs '-56267E-10' -> '0.0000056267'
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
85 absx061 abs '-56267E-5' -> '0.56267'
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
86 absx062 abs '-56267E-2' -> '562.67'
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
87 absx063 abs '-56267E-1' -> '5626.7'
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
88 absx065 abs '-56267E-0' -> '56267'
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
89
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
90 -- overflow tests
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
91 maxexponent: 999999999
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
92 minexponent: -999999999
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
93 precision: 3
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
94 absx120 abs 9.999E+999999999 -> Infinity Inexact Overflow Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
95
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
96 -- subnormals and underflow
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
97 precision: 3
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
98 maxexponent: 999
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
99 minexponent: -999
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
100 absx210 abs 1.00E-999 -> 1.00E-999
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
101 absx211 abs 0.1E-999 -> 1E-1000 Subnormal
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
102 absx212 abs 0.10E-999 -> 1.0E-1000 Subnormal
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
103 absx213 abs 0.100E-999 -> 1.0E-1000 Subnormal Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
104 absx214 abs 0.01E-999 -> 1E-1001 Subnormal
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
105 -- next is rounded to Emin
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
106 absx215 abs 0.999E-999 -> 1.00E-999 Inexact Rounded Subnormal Underflow
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
107 absx216 abs 0.099E-999 -> 1.0E-1000 Inexact Rounded Subnormal Underflow
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
108 absx217 abs 0.009E-999 -> 1E-1001 Inexact Rounded Subnormal Underflow
43400
1bac386c17cc Merged revisions 58095-58132,58136-58148,58151-58197 via svnmerge from
Thomas Wouters <thomas@python.org>
parents: 33158
diff changeset
109 absx218 abs 0.001E-999 -> 0E-1001 Inexact Rounded Subnormal Underflow Clamped
1bac386c17cc Merged revisions 58095-58132,58136-58148,58151-58197 via svnmerge from
Thomas Wouters <thomas@python.org>
parents: 33158
diff changeset
110 absx219 abs 0.0009E-999 -> 0E-1001 Inexact Rounded Subnormal Underflow Clamped
1bac386c17cc Merged revisions 58095-58132,58136-58148,58151-58197 via svnmerge from
Thomas Wouters <thomas@python.org>
parents: 33158
diff changeset
111 absx220 abs 0.0001E-999 -> 0E-1001 Inexact Rounded Subnormal Underflow Clamped
32451
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
112
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
113 absx230 abs -1.00E-999 -> 1.00E-999
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
114 absx231 abs -0.1E-999 -> 1E-1000 Subnormal
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
115 absx232 abs -0.10E-999 -> 1.0E-1000 Subnormal
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
116 absx233 abs -0.100E-999 -> 1.0E-1000 Subnormal Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
117 absx234 abs -0.01E-999 -> 1E-1001 Subnormal
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
118 -- next is rounded to Emin
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
119 absx235 abs -0.999E-999 -> 1.00E-999 Inexact Rounded Subnormal Underflow
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
120 absx236 abs -0.099E-999 -> 1.0E-1000 Inexact Rounded Subnormal Underflow
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
121 absx237 abs -0.009E-999 -> 1E-1001 Inexact Rounded Subnormal Underflow
43400
1bac386c17cc Merged revisions 58095-58132,58136-58148,58151-58197 via svnmerge from
Thomas Wouters <thomas@python.org>
parents: 33158
diff changeset
122 absx238 abs -0.001E-999 -> 0E-1001 Inexact Rounded Subnormal Underflow Clamped
1bac386c17cc Merged revisions 58095-58132,58136-58148,58151-58197 via svnmerge from
Thomas Wouters <thomas@python.org>
parents: 33158
diff changeset
123 absx239 abs -0.0009E-999 -> 0E-1001 Inexact Rounded Subnormal Underflow Clamped
1bac386c17cc Merged revisions 58095-58132,58136-58148,58151-58197 via svnmerge from
Thomas Wouters <thomas@python.org>
parents: 33158
diff changeset
124 absx240 abs -0.0001E-999 -> 0E-1001 Inexact Rounded Subnormal Underflow Clamped
32451
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
125
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
126 -- long operand tests
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
127 maxexponent: 999
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
128 minexponent: -999
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
129 precision: 9
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
130 absx301 abs 12345678000 -> 1.23456780E+10 Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
131 absx302 abs 1234567800 -> 1.23456780E+9 Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
132 absx303 abs 1234567890 -> 1.23456789E+9 Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
133 absx304 abs 1234567891 -> 1.23456789E+9 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
134 absx305 abs 12345678901 -> 1.23456789E+10 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
135 absx306 abs 1234567896 -> 1.23456790E+9 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
136
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
137 precision: 15
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
138 absx321 abs 12345678000 -> 12345678000
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
139 absx322 abs 1234567800 -> 1234567800
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
140 absx323 abs 1234567890 -> 1234567890
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
141 absx324 abs 1234567891 -> 1234567891
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
142 absx325 abs 12345678901 -> 12345678901
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
143 absx326 abs 1234567896 -> 1234567896
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
144
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
145
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
146 -- Specials
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
147 precision: 9
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
148
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
149 -- specials
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
150 absx520 abs 'Inf' -> 'Infinity'
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
151 absx521 abs '-Inf' -> 'Infinity'
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
152 absx522 abs NaN -> NaN
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
153 absx523 abs sNaN -> NaN Invalid_operation
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
154 absx524 abs NaN22 -> NaN22
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
155 absx525 abs sNaN33 -> NaN33 Invalid_operation
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
156 absx526 abs -NaN22 -> -NaN22
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
157 absx527 abs -sNaN33 -> -NaN33 Invalid_operation
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
158
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
159 -- Null tests
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
160 absx900 abs # -> NaN Invalid_operation
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
161