annotate Lib/test/decimaltestdata/quantize.decTest @ 79675:c0a2294de787 2.7

Issue #16199: Backport 2to3 typo fix from 3.2.
author Chris Jerdonek <chris.jerdonek@gmail.com>
date Thu, 11 Oct 2012 16:15:46 -0700
parents 787b969d37f0
children
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 -- quantize.decTest -- decimal quantize operation --
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 ------------------------------------------------------------------------
56838
670caa9775f6 Merged revisions 75286 via svnmerge from
Mark Dickinson <dickinsm@gmail.com>
parents: 48595
diff changeset
20 version: 2.59
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 -- Most of the tests here assume a "regular pattern", where the
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
23 -- sign and coefficient are +1.
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
24 -- 2004.03.15 Underflow for quantize is suppressed
44600
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
25 -- 2005.06.08 More extensive tests for 'does not fit'
32451
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
26
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
27 extended: 1
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
28 precision: 9
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
29 rounding: half_up
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
30 maxExponent: 999
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
31 minexponent: -999
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
32
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
33 -- sanity checks
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
34 quax001 quantize 0 1e0 -> 0
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
35 quax002 quantize 1 1e0 -> 1
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
36 quax003 quantize 0.1 1e+2 -> 0E+2 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
37 quax005 quantize 0.1 1e+1 -> 0E+1 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
38 quax006 quantize 0.1 1e0 -> 0 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
39 quax007 quantize 0.1 1e-1 -> 0.1
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
40 quax008 quantize 0.1 1e-2 -> 0.10
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
41 quax009 quantize 0.1 1e-3 -> 0.100
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
42 quax010 quantize 0.9 1e+2 -> 0E+2 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
43 quax011 quantize 0.9 1e+1 -> 0E+1 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
44 quax012 quantize 0.9 1e+0 -> 1 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
45 quax013 quantize 0.9 1e-1 -> 0.9
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
46 quax014 quantize 0.9 1e-2 -> 0.90
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
47 quax015 quantize 0.9 1e-3 -> 0.900
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
48 -- negatives
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
49 quax021 quantize -0 1e0 -> -0
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
50 quax022 quantize -1 1e0 -> -1
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
51 quax023 quantize -0.1 1e+2 -> -0E+2 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
52 quax025 quantize -0.1 1e+1 -> -0E+1 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
53 quax026 quantize -0.1 1e0 -> -0 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
54 quax027 quantize -0.1 1e-1 -> -0.1
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
55 quax028 quantize -0.1 1e-2 -> -0.10
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
56 quax029 quantize -0.1 1e-3 -> -0.100
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
57 quax030 quantize -0.9 1e+2 -> -0E+2 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
58 quax031 quantize -0.9 1e+1 -> -0E+1 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
59 quax032 quantize -0.9 1e+0 -> -1 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
60 quax033 quantize -0.9 1e-1 -> -0.9
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
61 quax034 quantize -0.9 1e-2 -> -0.90
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
62 quax035 quantize -0.9 1e-3 -> -0.900
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
63 quax036 quantize -0.5 1e+2 -> -0E+2 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
64 quax037 quantize -0.5 1e+1 -> -0E+1 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
65 quax038 quantize -0.5 1e+0 -> -1 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
66 quax039 quantize -0.5 1e-1 -> -0.5
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
67 quax040 quantize -0.5 1e-2 -> -0.50
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
68 quax041 quantize -0.5 1e-3 -> -0.500
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
69 quax042 quantize -0.9 1e+2 -> -0E+2 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
70 quax043 quantize -0.9 1e+1 -> -0E+1 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
71 quax044 quantize -0.9 1e+0 -> -1 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
72 quax045 quantize -0.9 1e-1 -> -0.9
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
73 quax046 quantize -0.9 1e-2 -> -0.90
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
74 quax047 quantize -0.9 1e-3 -> -0.900
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
75
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
76 -- examples from Specification
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
77 quax060 quantize 2.17 0.001 -> 2.170
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
78 quax061 quantize 2.17 0.01 -> 2.17
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
79 quax062 quantize 2.17 0.1 -> 2.2 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
80 quax063 quantize 2.17 1e+0 -> 2 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
81 quax064 quantize 2.17 1e+1 -> 0E+1 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
82 quax065 quantize -Inf Inf -> -Infinity
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
83 quax066 quantize 2 Inf -> NaN Invalid_operation
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
84 quax067 quantize -0.1 1 -> -0 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
85 quax068 quantize -0 1e+5 -> -0E+5
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
86 quax069 quantize +35236450.6 1e-2 -> NaN Invalid_operation
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
87 quax070 quantize -35236450.6 1e-2 -> NaN Invalid_operation
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
88 quax071 quantize 217 1e-1 -> 217.0
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
89 quax072 quantize 217 1e+0 -> 217
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
90 quax073 quantize 217 1e+1 -> 2.2E+2 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
91 quax074 quantize 217 1e+2 -> 2E+2 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
92
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
93 -- general tests ..
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
94 quax089 quantize 12 1e+4 -> 0E+4 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
95 quax090 quantize 12 1e+3 -> 0E+3 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
96 quax091 quantize 12 1e+2 -> 0E+2 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
97 quax092 quantize 12 1e+1 -> 1E+1 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
98 quax093 quantize 1.2345 1e-2 -> 1.23 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
99 quax094 quantize 1.2355 1e-2 -> 1.24 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
100 quax095 quantize 1.2345 1e-6 -> 1.234500
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
101 quax096 quantize 9.9999 1e-2 -> 10.00 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
102 quax097 quantize 0.0001 1e-2 -> 0.00 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
103 quax098 quantize 0.001 1e-2 -> 0.00 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
104 quax099 quantize 0.009 1e-2 -> 0.01 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
105 quax100 quantize 92 1e+2 -> 1E+2 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
106
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
107 quax101 quantize -1 1e0 -> -1
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
108 quax102 quantize -1 1e-1 -> -1.0
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
109 quax103 quantize -1 1e-2 -> -1.00
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
110 quax104 quantize 0 1e0 -> 0
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
111 quax105 quantize 0 1e-1 -> 0.0
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
112 quax106 quantize 0 1e-2 -> 0.00
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
113 quax107 quantize 0.00 1e0 -> 0
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
114 quax108 quantize 0 1e+1 -> 0E+1
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
115 quax109 quantize 0 1e+2 -> 0E+2
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
116 quax110 quantize +1 1e0 -> 1
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
117 quax111 quantize +1 1e-1 -> 1.0
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
118 quax112 quantize +1 1e-2 -> 1.00
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
119
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
120 quax120 quantize 1.04 1e-3 -> 1.040
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
121 quax121 quantize 1.04 1e-2 -> 1.04
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
122 quax122 quantize 1.04 1e-1 -> 1.0 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
123 quax123 quantize 1.04 1e0 -> 1 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
124 quax124 quantize 1.05 1e-3 -> 1.050
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
125 quax125 quantize 1.05 1e-2 -> 1.05
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
126 quax126 quantize 1.05 1e-1 -> 1.1 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
127 quax131 quantize 1.05 1e0 -> 1 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
128 quax132 quantize 1.06 1e-3 -> 1.060
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
129 quax133 quantize 1.06 1e-2 -> 1.06
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
130 quax134 quantize 1.06 1e-1 -> 1.1 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
131 quax135 quantize 1.06 1e0 -> 1 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
132
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
133 quax140 quantize -10 1e-2 -> -10.00
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
134 quax141 quantize +1 1e-2 -> 1.00
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
135 quax142 quantize +10 1e-2 -> 10.00
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
136 quax143 quantize 1E+10 1e-2 -> NaN Invalid_operation
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
137 quax144 quantize 1E-10 1e-2 -> 0.00 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
138 quax145 quantize 1E-3 1e-2 -> 0.00 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
139 quax146 quantize 1E-2 1e-2 -> 0.01
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
140 quax147 quantize 1E-1 1e-2 -> 0.10
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
141 quax148 quantize 0E-10 1e-2 -> 0.00
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
142
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
143 quax150 quantize 1.0600 1e-5 -> 1.06000
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
144 quax151 quantize 1.0600 1e-4 -> 1.0600
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
145 quax152 quantize 1.0600 1e-3 -> 1.060 Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
146 quax153 quantize 1.0600 1e-2 -> 1.06 Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
147 quax154 quantize 1.0600 1e-1 -> 1.1 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
148 quax155 quantize 1.0600 1e0 -> 1 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
149
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
150 -- base tests with non-1 coefficients
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
151 quax161 quantize 0 -9e0 -> 0
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
152 quax162 quantize 1 -7e0 -> 1
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
153 quax163 quantize 0.1 -1e+2 -> 0E+2 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
154 quax165 quantize 0.1 0e+1 -> 0E+1 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
155 quax166 quantize 0.1 2e0 -> 0 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
156 quax167 quantize 0.1 3e-1 -> 0.1
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
157 quax168 quantize 0.1 44e-2 -> 0.10
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
158 quax169 quantize 0.1 555e-3 -> 0.100
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
159 quax170 quantize 0.9 6666e+2 -> 0E+2 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
160 quax171 quantize 0.9 -777e+1 -> 0E+1 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
161 quax172 quantize 0.9 -88e+0 -> 1 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
162 quax173 quantize 0.9 -9e-1 -> 0.9
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
163 quax174 quantize 0.9 0e-2 -> 0.90
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
164 quax175 quantize 0.9 1.1e-3 -> 0.9000
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
165 -- negatives
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
166 quax181 quantize -0 1.1e0 -> -0.0
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
167 quax182 quantize -1 -1e0 -> -1
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
168 quax183 quantize -0.1 11e+2 -> -0E+2 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
169 quax185 quantize -0.1 111e+1 -> -0E+1 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
170 quax186 quantize -0.1 71e0 -> -0 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
171 quax187 quantize -0.1 -91e-1 -> -0.1
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
172 quax188 quantize -0.1 -.1e-2 -> -0.100
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
173 quax189 quantize -0.1 -1e-3 -> -0.100
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
174 quax190 quantize -0.9 0e+2 -> -0E+2 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
175 quax191 quantize -0.9 -0e+1 -> -0E+1 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
176 quax192 quantize -0.9 -10e+0 -> -1 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
177 quax193 quantize -0.9 100e-1 -> -0.9
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
178 quax194 quantize -0.9 999e-2 -> -0.90
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
179
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
180 -- +ve exponents ..
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
181 quax201 quantize -1 1e+0 -> -1
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
182 quax202 quantize -1 1e+1 -> -0E+1 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
183 quax203 quantize -1 1e+2 -> -0E+2 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
184 quax204 quantize 0 1e+0 -> 0
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
185 quax205 quantize 0 1e+1 -> 0E+1
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
186 quax206 quantize 0 1e+2 -> 0E+2
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
187 quax207 quantize +1 1e+0 -> 1
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
188 quax208 quantize +1 1e+1 -> 0E+1 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
189 quax209 quantize +1 1e+2 -> 0E+2 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
190
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
191 quax220 quantize 1.04 1e+3 -> 0E+3 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
192 quax221 quantize 1.04 1e+2 -> 0E+2 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
193 quax222 quantize 1.04 1e+1 -> 0E+1 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
194 quax223 quantize 1.04 1e+0 -> 1 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
195 quax224 quantize 1.05 1e+3 -> 0E+3 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
196 quax225 quantize 1.05 1e+2 -> 0E+2 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
197 quax226 quantize 1.05 1e+1 -> 0E+1 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
198 quax227 quantize 1.05 1e+0 -> 1 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
199 quax228 quantize 1.05 1e+3 -> 0E+3 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
200 quax229 quantize 1.05 1e+2 -> 0E+2 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
201 quax230 quantize 1.05 1e+1 -> 0E+1 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
202 quax231 quantize 1.05 1e+0 -> 1 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
203 quax232 quantize 1.06 1e+3 -> 0E+3 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
204 quax233 quantize 1.06 1e+2 -> 0E+2 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
205 quax234 quantize 1.06 1e+1 -> 0E+1 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
206 quax235 quantize 1.06 1e+0 -> 1 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
207
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
208 quax240 quantize -10 1e+1 -> -1E+1 Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
209 quax241 quantize +1 1e+1 -> 0E+1 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
210 quax242 quantize +10 1e+1 -> 1E+1 Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
211 quax243 quantize 1E+1 1e+1 -> 1E+1 -- underneath this is E+1
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
212 quax244 quantize 1E+2 1e+1 -> 1.0E+2 -- underneath this is E+1
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
213 quax245 quantize 1E+3 1e+1 -> 1.00E+3 -- underneath this is E+1
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
214 quax246 quantize 1E+4 1e+1 -> 1.000E+4 -- underneath this is E+1
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
215 quax247 quantize 1E+5 1e+1 -> 1.0000E+5 -- underneath this is E+1
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
216 quax248 quantize 1E+6 1e+1 -> 1.00000E+6 -- underneath this is E+1
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
217 quax249 quantize 1E+7 1e+1 -> 1.000000E+7 -- underneath this is E+1
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
218 quax250 quantize 1E+8 1e+1 -> 1.0000000E+8 -- underneath this is E+1
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
219 quax251 quantize 1E+9 1e+1 -> 1.00000000E+9 -- underneath this is E+1
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
220 -- next one tries to add 9 zeros
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
221 quax252 quantize 1E+10 1e+1 -> NaN Invalid_operation
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
222 quax253 quantize 1E-10 1e+1 -> 0E+1 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
223 quax254 quantize 1E-2 1e+1 -> 0E+1 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
224 quax255 quantize 0E-10 1e+1 -> 0E+1
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
225 quax256 quantize -0E-10 1e+1 -> -0E+1
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
226 quax257 quantize -0E-1 1e+1 -> -0E+1
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
227 quax258 quantize -0 1e+1 -> -0E+1
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
228 quax259 quantize -0E+1 1e+1 -> -0E+1
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
229
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
230 quax260 quantize -10 1e+2 -> -0E+2 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
231 quax261 quantize +1 1e+2 -> 0E+2 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
232 quax262 quantize +10 1e+2 -> 0E+2 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
233 quax263 quantize 1E+1 1e+2 -> 0E+2 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
234 quax264 quantize 1E+2 1e+2 -> 1E+2
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
235 quax265 quantize 1E+3 1e+2 -> 1.0E+3
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
236 quax266 quantize 1E+4 1e+2 -> 1.00E+4
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
237 quax267 quantize 1E+5 1e+2 -> 1.000E+5
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
238 quax268 quantize 1E+6 1e+2 -> 1.0000E+6
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
239 quax269 quantize 1E+7 1e+2 -> 1.00000E+7
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
240 quax270 quantize 1E+8 1e+2 -> 1.000000E+8
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
241 quax271 quantize 1E+9 1e+2 -> 1.0000000E+9
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
242 quax272 quantize 1E+10 1e+2 -> 1.00000000E+10
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
243 quax273 quantize 1E-10 1e+2 -> 0E+2 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
244 quax274 quantize 1E-2 1e+2 -> 0E+2 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
245 quax275 quantize 0E-10 1e+2 -> 0E+2
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
246
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
247 quax280 quantize -10 1e+3 -> -0E+3 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
248 quax281 quantize +1 1e+3 -> 0E+3 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
249 quax282 quantize +10 1e+3 -> 0E+3 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
250 quax283 quantize 1E+1 1e+3 -> 0E+3 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
251 quax284 quantize 1E+2 1e+3 -> 0E+3 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
252 quax285 quantize 1E+3 1e+3 -> 1E+3
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
253 quax286 quantize 1E+4 1e+3 -> 1.0E+4
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
254 quax287 quantize 1E+5 1e+3 -> 1.00E+5
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
255 quax288 quantize 1E+6 1e+3 -> 1.000E+6
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
256 quax289 quantize 1E+7 1e+3 -> 1.0000E+7
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
257 quax290 quantize 1E+8 1e+3 -> 1.00000E+8
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
258 quax291 quantize 1E+9 1e+3 -> 1.000000E+9
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
259 quax292 quantize 1E+10 1e+3 -> 1.0000000E+10
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
260 quax293 quantize 1E-10 1e+3 -> 0E+3 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
261 quax294 quantize 1E-2 1e+3 -> 0E+3 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
262 quax295 quantize 0E-10 1e+3 -> 0E+3
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
263
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
264 -- round up from below [sign wrong in JIT compiler once]
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
265 quax300 quantize 0.0078 1e-5 -> 0.00780
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
266 quax301 quantize 0.0078 1e-4 -> 0.0078
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
267 quax302 quantize 0.0078 1e-3 -> 0.008 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
268 quax303 quantize 0.0078 1e-2 -> 0.01 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
269 quax304 quantize 0.0078 1e-1 -> 0.0 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
270 quax305 quantize 0.0078 1e0 -> 0 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
271 quax306 quantize 0.0078 1e+1 -> 0E+1 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
272 quax307 quantize 0.0078 1e+2 -> 0E+2 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
273
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
274 quax310 quantize -0.0078 1e-5 -> -0.00780
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
275 quax311 quantize -0.0078 1e-4 -> -0.0078
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
276 quax312 quantize -0.0078 1e-3 -> -0.008 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
277 quax313 quantize -0.0078 1e-2 -> -0.01 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
278 quax314 quantize -0.0078 1e-1 -> -0.0 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
279 quax315 quantize -0.0078 1e0 -> -0 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
280 quax316 quantize -0.0078 1e+1 -> -0E+1 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
281 quax317 quantize -0.0078 1e+2 -> -0E+2 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
282
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
283 quax320 quantize 0.078 1e-5 -> 0.07800
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
284 quax321 quantize 0.078 1e-4 -> 0.0780
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
285 quax322 quantize 0.078 1e-3 -> 0.078
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
286 quax323 quantize 0.078 1e-2 -> 0.08 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
287 quax324 quantize 0.078 1e-1 -> 0.1 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
288 quax325 quantize 0.078 1e0 -> 0 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
289 quax326 quantize 0.078 1e+1 -> 0E+1 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
290 quax327 quantize 0.078 1e+2 -> 0E+2 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
291
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
292 quax330 quantize -0.078 1e-5 -> -0.07800
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
293 quax331 quantize -0.078 1e-4 -> -0.0780
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
294 quax332 quantize -0.078 1e-3 -> -0.078
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
295 quax333 quantize -0.078 1e-2 -> -0.08 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
296 quax334 quantize -0.078 1e-1 -> -0.1 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
297 quax335 quantize -0.078 1e0 -> -0 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
298 quax336 quantize -0.078 1e+1 -> -0E+1 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
299 quax337 quantize -0.078 1e+2 -> -0E+2 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
300
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
301 quax340 quantize 0.78 1e-5 -> 0.78000
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
302 quax341 quantize 0.78 1e-4 -> 0.7800
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
303 quax342 quantize 0.78 1e-3 -> 0.780
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
304 quax343 quantize 0.78 1e-2 -> 0.78
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
305 quax344 quantize 0.78 1e-1 -> 0.8 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
306 quax345 quantize 0.78 1e0 -> 1 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
307 quax346 quantize 0.78 1e+1 -> 0E+1 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
308 quax347 quantize 0.78 1e+2 -> 0E+2 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
309
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
310 quax350 quantize -0.78 1e-5 -> -0.78000
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
311 quax351 quantize -0.78 1e-4 -> -0.7800
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
312 quax352 quantize -0.78 1e-3 -> -0.780
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
313 quax353 quantize -0.78 1e-2 -> -0.78
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
314 quax354 quantize -0.78 1e-1 -> -0.8 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
315 quax355 quantize -0.78 1e0 -> -1 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
316 quax356 quantize -0.78 1e+1 -> -0E+1 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
317 quax357 quantize -0.78 1e+2 -> -0E+2 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
318
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
319 quax360 quantize 7.8 1e-5 -> 7.80000
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
320 quax361 quantize 7.8 1e-4 -> 7.8000
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
321 quax362 quantize 7.8 1e-3 -> 7.800
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
322 quax363 quantize 7.8 1e-2 -> 7.80
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
323 quax364 quantize 7.8 1e-1 -> 7.8
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
324 quax365 quantize 7.8 1e0 -> 8 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
325 quax366 quantize 7.8 1e+1 -> 1E+1 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
326 quax367 quantize 7.8 1e+2 -> 0E+2 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
327 quax368 quantize 7.8 1e+3 -> 0E+3 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
328
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
329 quax370 quantize -7.8 1e-5 -> -7.80000
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
330 quax371 quantize -7.8 1e-4 -> -7.8000
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
331 quax372 quantize -7.8 1e-3 -> -7.800
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
332 quax373 quantize -7.8 1e-2 -> -7.80
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
333 quax374 quantize -7.8 1e-1 -> -7.8
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
334 quax375 quantize -7.8 1e0 -> -8 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
335 quax376 quantize -7.8 1e+1 -> -1E+1 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
336 quax377 quantize -7.8 1e+2 -> -0E+2 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
337 quax378 quantize -7.8 1e+3 -> -0E+3 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
338
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
339 -- some individuals
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
340 precision: 9
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
341 quax380 quantize 352364.506 1e-2 -> 352364.51 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
342 quax381 quantize 3523645.06 1e-2 -> 3523645.06
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
343 quax382 quantize 35236450.6 1e-2 -> NaN Invalid_operation
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
344 quax383 quantize 352364506 1e-2 -> NaN Invalid_operation
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
345 quax384 quantize -352364.506 1e-2 -> -352364.51 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
346 quax385 quantize -3523645.06 1e-2 -> -3523645.06
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
347 quax386 quantize -35236450.6 1e-2 -> NaN Invalid_operation
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
348 quax387 quantize -352364506 1e-2 -> NaN Invalid_operation
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
349
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
350 rounding: down
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
351 quax389 quantize 35236450.6 1e-2 -> NaN Invalid_operation
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
352 -- ? should that one instead have been:
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
353 -- quax389 quantize 35236450.6 1e-2 -> NaN Invalid_operation
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
354 rounding: half_up
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
355
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
356 -- and a few more from e-mail discussions
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
357 precision: 7
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
358 quax391 quantize 12.34567 1e-3 -> 12.346 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
359 quax392 quantize 123.4567 1e-3 -> 123.457 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
360 quax393 quantize 1234.567 1e-3 -> 1234.567
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
361 quax394 quantize 12345.67 1e-3 -> NaN Invalid_operation
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
362 quax395 quantize 123456.7 1e-3 -> NaN Invalid_operation
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
363 quax396 quantize 1234567. 1e-3 -> NaN Invalid_operation
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
364
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
365 -- some 9999 round-up cases
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
366 precision: 9
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
367 quax400 quantize 9.999 1e-5 -> 9.99900
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
368 quax401 quantize 9.999 1e-4 -> 9.9990
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
369 quax402 quantize 9.999 1e-3 -> 9.999
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
370 quax403 quantize 9.999 1e-2 -> 10.00 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
371 quax404 quantize 9.999 1e-1 -> 10.0 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
372 quax405 quantize 9.999 1e0 -> 10 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
373 quax406 quantize 9.999 1e1 -> 1E+1 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
374 quax407 quantize 9.999 1e2 -> 0E+2 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
375
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
376 quax410 quantize 0.999 1e-5 -> 0.99900
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
377 quax411 quantize 0.999 1e-4 -> 0.9990
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
378 quax412 quantize 0.999 1e-3 -> 0.999
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
379 quax413 quantize 0.999 1e-2 -> 1.00 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
380 quax414 quantize 0.999 1e-1 -> 1.0 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
381 quax415 quantize 0.999 1e0 -> 1 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
382 quax416 quantize 0.999 1e1 -> 0E+1 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
383
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
384 quax420 quantize 0.0999 1e-5 -> 0.09990
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
385 quax421 quantize 0.0999 1e-4 -> 0.0999
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
386 quax422 quantize 0.0999 1e-3 -> 0.100 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
387 quax423 quantize 0.0999 1e-2 -> 0.10 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
388 quax424 quantize 0.0999 1e-1 -> 0.1 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
389 quax425 quantize 0.0999 1e0 -> 0 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
390 quax426 quantize 0.0999 1e1 -> 0E+1 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
391
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
392 quax430 quantize 0.00999 1e-5 -> 0.00999
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
393 quax431 quantize 0.00999 1e-4 -> 0.0100 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
394 quax432 quantize 0.00999 1e-3 -> 0.010 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
395 quax433 quantize 0.00999 1e-2 -> 0.01 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
396 quax434 quantize 0.00999 1e-1 -> 0.0 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
397 quax435 quantize 0.00999 1e0 -> 0 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
398 quax436 quantize 0.00999 1e1 -> 0E+1 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
399
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
400 quax440 quantize 0.000999 1e-5 -> 0.00100 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
401 quax441 quantize 0.000999 1e-4 -> 0.0010 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
402 quax442 quantize 0.000999 1e-3 -> 0.001 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
403 quax443 quantize 0.000999 1e-2 -> 0.00 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
404 quax444 quantize 0.000999 1e-1 -> 0.0 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
405 quax445 quantize 0.000999 1e0 -> 0 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
406 quax446 quantize 0.000999 1e1 -> 0E+1 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
407
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
408 precision: 8
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
409 quax449 quantize 9.999E-15 1e-23 -> NaN Invalid_operation
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
410 quax450 quantize 9.999E-15 1e-22 -> 9.9990000E-15
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
411 quax451 quantize 9.999E-15 1e-21 -> 9.999000E-15
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
412 quax452 quantize 9.999E-15 1e-20 -> 9.99900E-15
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
413 quax453 quantize 9.999E-15 1e-19 -> 9.9990E-15
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
414 quax454 quantize 9.999E-15 1e-18 -> 9.999E-15
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
415 quax455 quantize 9.999E-15 1e-17 -> 1.000E-14 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
416 quax456 quantize 9.999E-15 1e-16 -> 1.00E-14 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
417 quax457 quantize 9.999E-15 1e-15 -> 1.0E-14 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
418 quax458 quantize 9.999E-15 1e-14 -> 1E-14 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
419 quax459 quantize 9.999E-15 1e-13 -> 0E-13 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
420 quax460 quantize 9.999E-15 1e-12 -> 0E-12 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
421 quax461 quantize 9.999E-15 1e-11 -> 0E-11 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
422 quax462 quantize 9.999E-15 1e-10 -> 0E-10 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
423 quax463 quantize 9.999E-15 1e-9 -> 0E-9 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
424 quax464 quantize 9.999E-15 1e-8 -> 0E-8 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
425 quax465 quantize 9.999E-15 1e-7 -> 0E-7 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
426 quax466 quantize 9.999E-15 1e-6 -> 0.000000 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
427 quax467 quantize 9.999E-15 1e-5 -> 0.00000 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
428 quax468 quantize 9.999E-15 1e-4 -> 0.0000 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
429 quax469 quantize 9.999E-15 1e-3 -> 0.000 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
430 quax470 quantize 9.999E-15 1e-2 -> 0.00 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
431 quax471 quantize 9.999E-15 1e-1 -> 0.0 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
432 quax472 quantize 9.999E-15 1e0 -> 0 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
433 quax473 quantize 9.999E-15 1e1 -> 0E+1 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
434
44600
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
435 precision: 7
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
436 quax900 quantize 9.999E-15 1e-22 -> NaN Invalid_operation
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
437 quax901 quantize 9.999E-15 1e-21 -> 9.999000E-15
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
438 quax902 quantize 9.999E-15 1e-20 -> 9.99900E-15
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
439 quax903 quantize 9.999E-15 1e-19 -> 9.9990E-15
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
440 quax904 quantize 9.999E-15 1e-18 -> 9.999E-15
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
441 quax905 quantize 9.999E-15 1e-17 -> 1.000E-14 Inexact Rounded
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
442 quax906 quantize 9.999E-15 1e-16 -> 1.00E-14 Inexact Rounded
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
443 quax907 quantize 9.999E-15 1e-15 -> 1.0E-14 Inexact Rounded
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
444 quax908 quantize 9.999E-15 1e-14 -> 1E-14 Inexact Rounded
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
445 quax909 quantize 9.999E-15 1e-13 -> 0E-13 Inexact Rounded
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
446 quax910 quantize 9.999E-15 1e-12 -> 0E-12 Inexact Rounded
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
447 quax911 quantize 9.999E-15 1e-11 -> 0E-11 Inexact Rounded
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
448 quax912 quantize 9.999E-15 1e-10 -> 0E-10 Inexact Rounded
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
449 quax913 quantize 9.999E-15 1e-9 -> 0E-9 Inexact Rounded
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
450 quax914 quantize 9.999E-15 1e-8 -> 0E-8 Inexact Rounded
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
451 quax915 quantize 9.999E-15 1e-7 -> 0E-7 Inexact Rounded
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
452 quax916 quantize 9.999E-15 1e-6 -> 0.000000 Inexact Rounded
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
453 quax917 quantize 9.999E-15 1e-5 -> 0.00000 Inexact Rounded
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
454 quax918 quantize 9.999E-15 1e-4 -> 0.0000 Inexact Rounded
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
455 quax919 quantize 9.999E-15 1e-3 -> 0.000 Inexact Rounded
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
456 quax920 quantize 9.999E-15 1e-2 -> 0.00 Inexact Rounded
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
457 quax921 quantize 9.999E-15 1e-1 -> 0.0 Inexact Rounded
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
458 quax922 quantize 9.999E-15 1e0 -> 0 Inexact Rounded
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
459 quax923 quantize 9.999E-15 1e1 -> 0E+1 Inexact Rounded
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
460
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
461 precision: 6
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
462 quax930 quantize 9.999E-15 1e-22 -> NaN Invalid_operation
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
463 quax931 quantize 9.999E-15 1e-21 -> NaN Invalid_operation
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
464 quax932 quantize 9.999E-15 1e-20 -> 9.99900E-15
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
465 quax933 quantize 9.999E-15 1e-19 -> 9.9990E-15
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
466 quax934 quantize 9.999E-15 1e-18 -> 9.999E-15
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
467 quax935 quantize 9.999E-15 1e-17 -> 1.000E-14 Inexact Rounded
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
468 quax936 quantize 9.999E-15 1e-16 -> 1.00E-14 Inexact Rounded
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
469 quax937 quantize 9.999E-15 1e-15 -> 1.0E-14 Inexact Rounded
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
470 quax938 quantize 9.999E-15 1e-14 -> 1E-14 Inexact Rounded
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
471 quax939 quantize 9.999E-15 1e-13 -> 0E-13 Inexact Rounded
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
472 quax940 quantize 9.999E-15 1e-12 -> 0E-12 Inexact Rounded
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
473 quax941 quantize 9.999E-15 1e-11 -> 0E-11 Inexact Rounded
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
474 quax942 quantize 9.999E-15 1e-10 -> 0E-10 Inexact Rounded
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
475 quax943 quantize 9.999E-15 1e-9 -> 0E-9 Inexact Rounded
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
476 quax944 quantize 9.999E-15 1e-8 -> 0E-8 Inexact Rounded
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
477 quax945 quantize 9.999E-15 1e-7 -> 0E-7 Inexact Rounded
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
478 quax946 quantize 9.999E-15 1e-6 -> 0.000000 Inexact Rounded
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
479 quax947 quantize 9.999E-15 1e-5 -> 0.00000 Inexact Rounded
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
480 quax948 quantize 9.999E-15 1e-4 -> 0.0000 Inexact Rounded
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
481 quax949 quantize 9.999E-15 1e-3 -> 0.000 Inexact Rounded
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
482 quax950 quantize 9.999E-15 1e-2 -> 0.00 Inexact Rounded
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
483 quax951 quantize 9.999E-15 1e-1 -> 0.0 Inexact Rounded
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
484 quax952 quantize 9.999E-15 1e0 -> 0 Inexact Rounded
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
485 quax953 quantize 9.999E-15 1e1 -> 0E+1 Inexact Rounded
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
486
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
487 precision: 3
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
488 quax960 quantize 9.999E-15 1e-22 -> NaN Invalid_operation
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
489 quax961 quantize 9.999E-15 1e-21 -> NaN Invalid_operation
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
490 quax962 quantize 9.999E-15 1e-20 -> NaN Invalid_operation
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
491 quax963 quantize 9.999E-15 1e-19 -> NaN Invalid_operation
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
492 quax964 quantize 9.999E-15 1e-18 -> NaN Invalid_operation
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
493 quax965 quantize 9.999E-15 1e-17 -> NaN Invalid_operation
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
494 quax966 quantize 9.999E-15 1e-16 -> 1.00E-14 Inexact Rounded
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
495 quax967 quantize 9.999E-15 1e-15 -> 1.0E-14 Inexact Rounded
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
496 quax968 quantize 9.999E-15 1e-14 -> 1E-14 Inexact Rounded
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
497 quax969 quantize 9.999E-15 1e-13 -> 0E-13 Inexact Rounded
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
498 quax970 quantize 9.999E-15 1e-12 -> 0E-12 Inexact Rounded
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
499 quax971 quantize 9.999E-15 1e-11 -> 0E-11 Inexact Rounded
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
500 quax972 quantize 9.999E-15 1e-10 -> 0E-10 Inexact Rounded
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
501 quax973 quantize 9.999E-15 1e-9 -> 0E-9 Inexact Rounded
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
502 quax974 quantize 9.999E-15 1e-8 -> 0E-8 Inexact Rounded
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
503 quax975 quantize 9.999E-15 1e-7 -> 0E-7 Inexact Rounded
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
504 quax976 quantize 9.999E-15 1e-6 -> 0.000000 Inexact Rounded
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
505 quax977 quantize 9.999E-15 1e-5 -> 0.00000 Inexact Rounded
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
506 quax978 quantize 9.999E-15 1e-4 -> 0.0000 Inexact Rounded
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
507 quax979 quantize 9.999E-15 1e-3 -> 0.000 Inexact Rounded
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
508 quax980 quantize 9.999E-15 1e-2 -> 0.00 Inexact Rounded
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
509 quax981 quantize 9.999E-15 1e-1 -> 0.0 Inexact Rounded
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
510 quax982 quantize 9.999E-15 1e0 -> 0 Inexact Rounded
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
511 quax983 quantize 9.999E-15 1e1 -> 0E+1 Inexact Rounded
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
512
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
513 -- Fung Lee's case & similar
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
514 precision: 3
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
515 quax1001 quantize 0.000 0.001 -> 0.000
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
516 quax1002 quantize 0.001 0.001 -> 0.001
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
517 quax1003 quantize 0.0012 0.001 -> 0.001 Inexact Rounded
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
518 quax1004 quantize 0.0018 0.001 -> 0.002 Inexact Rounded
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
519 quax1005 quantize 0.501 0.001 -> 0.501
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
520 quax1006 quantize 0.5012 0.001 -> 0.501 Inexact Rounded
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
521 quax1007 quantize 0.5018 0.001 -> 0.502 Inexact Rounded
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
522 quax1008 quantize 0.999 0.001 -> 0.999
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
523 quax1009 quantize 0.9992 0.001 -> 0.999 Inexact Rounded
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
524 quax1010 quantize 0.9998 0.001 -> NaN Invalid_operation
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
525 quax1011 quantize 1.0001 0.001 -> NaN Invalid_operation
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
526 quax1012 quantize 1.0051 0.001 -> NaN Invalid_operation
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
527 quax1013 quantize 1.0551 0.001 -> NaN Invalid_operation
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
528 quax1014 quantize 1.5551 0.001 -> NaN Invalid_operation
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
529 quax1015 quantize 1.9999 0.001 -> NaN Invalid_operation
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
530
32451
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
531 -- long operand checks [rhs checks removed]
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
532 maxexponent: 999
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
533 minexponent: -999
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
534 precision: 9
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
535 quax481 quantize 12345678000 1e+3 -> 1.2345678E+10 Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
536 quax482 quantize 1234567800 1e+1 -> 1.23456780E+9 Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
537 quax483 quantize 1234567890 1e+1 -> 1.23456789E+9 Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
538 quax484 quantize 1234567891 1e+1 -> 1.23456789E+9 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
539 quax485 quantize 12345678901 1e+2 -> 1.23456789E+10 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
540 quax486 quantize 1234567896 1e+1 -> 1.23456790E+9 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
541 -- a potential double-round
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
542 quax487 quantize 1234.987643 1e-4 -> 1234.9876 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
543 quax488 quantize 1234.987647 1e-4 -> 1234.9876 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
544
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
545 precision: 15
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
546 quax491 quantize 12345678000 1e+3 -> 1.2345678E+10 Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
547 quax492 quantize 1234567800 1e+1 -> 1.23456780E+9 Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
548 quax493 quantize 1234567890 1e+1 -> 1.23456789E+9 Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
549 quax494 quantize 1234567891 1e+1 -> 1.23456789E+9 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
550 quax495 quantize 12345678901 1e+2 -> 1.23456789E+10 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
551 quax496 quantize 1234567896 1e+1 -> 1.23456790E+9 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
552 quax497 quantize 1234.987643 1e-4 -> 1234.9876 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
553 quax498 quantize 1234.987647 1e-4 -> 1234.9876 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
554
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
555 -- Zeros
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
556 quax500 quantize 0 1e1 -> 0E+1
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
557 quax501 quantize 0 1e0 -> 0
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
558 quax502 quantize 0 1e-1 -> 0.0
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
559 quax503 quantize 0.0 1e-1 -> 0.0
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
560 quax504 quantize 0.0 1e0 -> 0
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
561 quax505 quantize 0.0 1e+1 -> 0E+1
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
562 quax506 quantize 0E+1 1e-1 -> 0.0
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
563 quax507 quantize 0E+1 1e0 -> 0
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
564 quax508 quantize 0E+1 1e+1 -> 0E+1
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
565 quax509 quantize -0 1e1 -> -0E+1
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
566 quax510 quantize -0 1e0 -> -0
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
567 quax511 quantize -0 1e-1 -> -0.0
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
568 quax512 quantize -0.0 1e-1 -> -0.0
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
569 quax513 quantize -0.0 1e0 -> -0
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
570 quax514 quantize -0.0 1e+1 -> -0E+1
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
571 quax515 quantize -0E+1 1e-1 -> -0.0
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
572 quax516 quantize -0E+1 1e0 -> -0
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
573 quax517 quantize -0E+1 1e+1 -> -0E+1
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
574
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
575 -- Suspicious RHS values
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
576 maxexponent: 999999999
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
577 minexponent: -999999999
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
578 precision: 15
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
579 quax520 quantize 1.234 1e999999000 -> 0E+999999000 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
580 quax521 quantize 123.456 1e999999000 -> 0E+999999000 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
581 quax522 quantize 1.234 1e999999999 -> 0E+999999999 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
582 quax523 quantize 123.456 1e999999999 -> 0E+999999999 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
583 quax524 quantize 123.456 1e1000000000 -> NaN Invalid_operation
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
584 quax525 quantize 123.456 1e12345678903 -> NaN Invalid_operation
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
585 -- next four are "won't fit" overflows
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
586 quax526 quantize 1.234 1e-999999000 -> NaN Invalid_operation
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
587 quax527 quantize 123.456 1e-999999000 -> NaN Invalid_operation
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
588 quax528 quantize 1.234 1e-999999999 -> NaN Invalid_operation
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
589 quax529 quantize 123.456 1e-999999999 -> NaN Invalid_operation
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
590 quax530 quantize 123.456 1e-1000000014 -> NaN Invalid_operation
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
591 quax531 quantize 123.456 1e-12345678903 -> NaN Invalid_operation
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
592
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
593 maxexponent: 999
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
594 minexponent: -999
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
595 precision: 15
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
596 quax532 quantize 1.234E+999 1e999 -> 1E+999 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
597 quax533 quantize 1.234E+998 1e999 -> 0E+999 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
598 quax534 quantize 1.234 1e999 -> 0E+999 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
599 quax535 quantize 1.234 1e1000 -> NaN Invalid_operation
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
600 quax536 quantize 1.234 1e5000 -> NaN Invalid_operation
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
601 quax537 quantize 0 1e-999 -> 0E-999
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
602 -- next two are "won't fit" overflows
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
603 quax538 quantize 1.234 1e-999 -> NaN Invalid_operation
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
604 quax539 quantize 1.234 1e-1000 -> NaN Invalid_operation
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
605 quax540 quantize 1.234 1e-5000 -> NaN Invalid_operation
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
606 -- [more below]
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
607
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
608 -- check bounds (lhs maybe out of range for destination, etc.)
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
609 precision: 7
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
610 quax541 quantize 1E+999 1e+999 -> 1E+999
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
611 quax542 quantize 1E+1000 1e+999 -> NaN Invalid_operation
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
612 quax543 quantize 1E+999 1e+1000 -> NaN Invalid_operation
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
613 quax544 quantize 1E-999 1e-999 -> 1E-999
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
614 quax545 quantize 1E-1000 1e-999 -> 0E-999 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
615 quax546 quantize 1E-999 1e-1000 -> 1.0E-999
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
616 quax547 quantize 1E-1005 1e-999 -> 0E-999 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
617 quax548 quantize 1E-1006 1e-999 -> 0E-999 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
618 quax549 quantize 1E-1007 1e-999 -> 0E-999 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
619 quax550 quantize 1E-998 1e-1005 -> NaN Invalid_operation -- won't fit
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
620 quax551 quantize 1E-999 1e-1005 -> 1.000000E-999
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
621 quax552 quantize 1E-1000 1e-1005 -> 1.00000E-1000 Subnormal
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
622 quax553 quantize 1E-999 1e-1006 -> NaN Invalid_operation
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
623 quax554 quantize 1E-999 1e-1007 -> NaN Invalid_operation
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
624 -- related subnormal rounding
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
625 quax555 quantize 1.666666E-999 1e-1005 -> 1.666666E-999
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
626 quax556 quantize 1.666666E-1000 1e-1005 -> 1.66667E-1000 Subnormal Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
627 quax557 quantize 1.666666E-1001 1e-1005 -> 1.6667E-1001 Subnormal Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
628 quax558 quantize 1.666666E-1002 1e-1005 -> 1.667E-1002 Subnormal Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
629 quax559 quantize 1.666666E-1003 1e-1005 -> 1.67E-1003 Subnormal Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
630 quax560 quantize 1.666666E-1004 1e-1005 -> 1.7E-1004 Subnormal Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
631 quax561 quantize 1.666666E-1005 1e-1005 -> 2E-1005 Subnormal Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
632 quax562 quantize 1.666666E-1006 1e-1005 -> 0E-1005 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
633 quax563 quantize 1.666666E-1007 1e-1005 -> 0E-1005 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
634
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
635 -- Specials
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
636 quax580 quantize Inf -Inf -> Infinity
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
637 quax581 quantize Inf 1e-1000 -> NaN Invalid_operation
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
638 quax582 quantize Inf 1e-1 -> NaN Invalid_operation
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
639 quax583 quantize Inf 1e0 -> NaN Invalid_operation
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
640 quax584 quantize Inf 1e1 -> NaN Invalid_operation
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
641 quax585 quantize Inf 1e1000 -> NaN Invalid_operation
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
642 quax586 quantize Inf Inf -> Infinity
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
643 quax587 quantize -1000 Inf -> NaN Invalid_operation
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
644 quax588 quantize -Inf Inf -> -Infinity
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
645 quax589 quantize -1 Inf -> NaN Invalid_operation
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
646 quax590 quantize 0 Inf -> NaN Invalid_operation
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
647 quax591 quantize 1 Inf -> NaN Invalid_operation
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
648 quax592 quantize 1000 Inf -> NaN Invalid_operation
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
649 quax593 quantize Inf Inf -> Infinity
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
650 quax594 quantize Inf 1e-0 -> NaN Invalid_operation
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
651 quax595 quantize -0 Inf -> NaN Invalid_operation
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
652
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
653 quax600 quantize -Inf -Inf -> -Infinity
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
654 quax601 quantize -Inf 1e-1000 -> NaN Invalid_operation
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
655 quax602 quantize -Inf 1e-1 -> NaN Invalid_operation
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
656 quax603 quantize -Inf 1e0 -> NaN Invalid_operation
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
657 quax604 quantize -Inf 1e1 -> NaN Invalid_operation
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
658 quax605 quantize -Inf 1e1000 -> NaN Invalid_operation
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
659 quax606 quantize -Inf Inf -> -Infinity
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
660 quax607 quantize -1000 Inf -> NaN Invalid_operation
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
661 quax608 quantize -Inf -Inf -> -Infinity
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
662 quax609 quantize -1 -Inf -> NaN Invalid_operation
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
663 quax610 quantize 0 -Inf -> NaN Invalid_operation
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
664 quax611 quantize 1 -Inf -> NaN Invalid_operation
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
665 quax612 quantize 1000 -Inf -> NaN Invalid_operation
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
666 quax613 quantize Inf -Inf -> Infinity
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
667 quax614 quantize -Inf 1e-0 -> NaN Invalid_operation
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
668 quax615 quantize -0 -Inf -> NaN Invalid_operation
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
669
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
670 quax621 quantize NaN -Inf -> NaN
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
671 quax622 quantize NaN 1e-1000 -> NaN
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
672 quax623 quantize NaN 1e-1 -> NaN
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
673 quax624 quantize NaN 1e0 -> NaN
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
674 quax625 quantize NaN 1e1 -> NaN
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
675 quax626 quantize NaN 1e1000 -> NaN
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
676 quax627 quantize NaN Inf -> NaN
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
677 quax628 quantize NaN NaN -> NaN
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
678 quax629 quantize -Inf NaN -> NaN
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
679 quax630 quantize -1000 NaN -> NaN
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
680 quax631 quantize -1 NaN -> NaN
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
681 quax632 quantize 0 NaN -> NaN
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
682 quax633 quantize 1 NaN -> NaN
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
683 quax634 quantize 1000 NaN -> NaN
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
684 quax635 quantize Inf NaN -> NaN
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
685 quax636 quantize NaN 1e-0 -> NaN
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
686 quax637 quantize -0 NaN -> NaN
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
687
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
688 quax641 quantize sNaN -Inf -> NaN Invalid_operation
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
689 quax642 quantize sNaN 1e-1000 -> NaN Invalid_operation
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
690 quax643 quantize sNaN 1e-1 -> NaN Invalid_operation
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
691 quax644 quantize sNaN 1e0 -> NaN Invalid_operation
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
692 quax645 quantize sNaN 1e1 -> NaN Invalid_operation
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
693 quax646 quantize sNaN 1e1000 -> NaN Invalid_operation
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
694 quax647 quantize sNaN NaN -> NaN Invalid_operation
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
695 quax648 quantize sNaN sNaN -> NaN Invalid_operation
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
696 quax649 quantize NaN sNaN -> NaN Invalid_operation
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
697 quax650 quantize -Inf sNaN -> NaN Invalid_operation
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
698 quax651 quantize -1000 sNaN -> NaN Invalid_operation
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
699 quax652 quantize -1 sNaN -> NaN Invalid_operation
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
700 quax653 quantize 0 sNaN -> NaN Invalid_operation
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
701 quax654 quantize 1 sNaN -> NaN Invalid_operation
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
702 quax655 quantize 1000 sNaN -> NaN Invalid_operation
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
703 quax656 quantize Inf sNaN -> NaN Invalid_operation
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
704 quax657 quantize NaN sNaN -> NaN Invalid_operation
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
705 quax658 quantize sNaN 1e-0 -> NaN Invalid_operation
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
706 quax659 quantize -0 sNaN -> NaN Invalid_operation
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
707
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
708 -- propagating NaNs
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
709 quax661 quantize NaN9 -Inf -> NaN9
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
710 quax662 quantize NaN8 919 -> NaN8
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
711 quax663 quantize NaN71 Inf -> NaN71
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
712 quax664 quantize NaN6 NaN5 -> NaN6
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
713 quax665 quantize -Inf NaN4 -> NaN4
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
714 quax666 quantize -919 NaN31 -> NaN31
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
715 quax667 quantize Inf NaN2 -> NaN2
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
716
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
717 quax671 quantize sNaN99 -Inf -> NaN99 Invalid_operation
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
718 quax672 quantize sNaN98 -11 -> NaN98 Invalid_operation
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
719 quax673 quantize sNaN97 NaN -> NaN97 Invalid_operation
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
720 quax674 quantize sNaN16 sNaN94 -> NaN16 Invalid_operation
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
721 quax675 quantize NaN95 sNaN93 -> NaN93 Invalid_operation
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
722 quax676 quantize -Inf sNaN92 -> NaN92 Invalid_operation
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
723 quax677 quantize 088 sNaN91 -> NaN91 Invalid_operation
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
724 quax678 quantize Inf sNaN90 -> NaN90 Invalid_operation
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
725 quax679 quantize NaN sNaN88 -> NaN88 Invalid_operation
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
726
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
727 quax681 quantize -NaN9 -Inf -> -NaN9
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
728 quax682 quantize -NaN8 919 -> -NaN8
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
729 quax683 quantize -NaN71 Inf -> -NaN71
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
730 quax684 quantize -NaN6 -NaN5 -> -NaN6
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
731 quax685 quantize -Inf -NaN4 -> -NaN4
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
732 quax686 quantize -919 -NaN31 -> -NaN31
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
733 quax687 quantize Inf -NaN2 -> -NaN2
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
734
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
735 quax691 quantize -sNaN99 -Inf -> -NaN99 Invalid_operation
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
736 quax692 quantize -sNaN98 -11 -> -NaN98 Invalid_operation
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
737 quax693 quantize -sNaN97 NaN -> -NaN97 Invalid_operation
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
738 quax694 quantize -sNaN16 sNaN94 -> -NaN16 Invalid_operation
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
739 quax695 quantize -NaN95 -sNaN93 -> -NaN93 Invalid_operation
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
740 quax696 quantize -Inf -sNaN92 -> -NaN92 Invalid_operation
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
741 quax697 quantize 088 -sNaN91 -> -NaN91 Invalid_operation
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
742 quax698 quantize Inf -sNaN90 -> -NaN90 Invalid_operation
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
743 quax699 quantize NaN -sNaN88 -> -NaN88 Invalid_operation
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
744
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
745 -- subnormals and underflow
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
746 precision: 4
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
747 maxexponent: 999
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
748 minexponent: -999
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
749 quax710 quantize 1.00E-999 1e-999 -> 1E-999 Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
750 quax711 quantize 0.1E-999 2e-1000 -> 1E-1000 Subnormal
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
751 quax712 quantize 0.10E-999 3e-1000 -> 1E-1000 Subnormal Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
752 quax713 quantize 0.100E-999 4e-1000 -> 1E-1000 Subnormal Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
753 quax714 quantize 0.01E-999 5e-1001 -> 1E-1001 Subnormal
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
754 -- next is rounded to Emin
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
755 quax715 quantize 0.999E-999 1e-999 -> 1E-999 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
756 quax716 quantize 0.099E-999 10e-1000 -> 1E-1000 Inexact Rounded Subnormal
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
757
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
758 quax717 quantize 0.009E-999 1e-1001 -> 1E-1001 Inexact Rounded Subnormal
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
759 quax718 quantize 0.001E-999 1e-1001 -> 0E-1001 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
760 quax719 quantize 0.0009E-999 1e-1001 -> 0E-1001 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
761 quax720 quantize 0.0001E-999 1e-1001 -> 0E-1001 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
762
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
763 quax730 quantize -1.00E-999 1e-999 -> -1E-999 Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
764 quax731 quantize -0.1E-999 1e-999 -> -0E-999 Rounded Inexact
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
765 quax732 quantize -0.10E-999 1e-999 -> -0E-999 Rounded Inexact
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
766 quax733 quantize -0.100E-999 1e-999 -> -0E-999 Rounded Inexact
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
767 quax734 quantize -0.01E-999 1e-999 -> -0E-999 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
768 -- next is rounded to Emin
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
769 quax735 quantize -0.999E-999 90e-999 -> -1E-999 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
770 quax736 quantize -0.099E-999 -1e-999 -> -0E-999 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
771 quax737 quantize -0.009E-999 -1e-999 -> -0E-999 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
772 quax738 quantize -0.001E-999 -0e-999 -> -0E-999 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
773 quax739 quantize -0.0001E-999 0e-999 -> -0E-999 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
774
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
775 quax740 quantize -1.00E-999 1e-1000 -> -1.0E-999 Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
776 quax741 quantize -0.1E-999 1e-1000 -> -1E-1000 Subnormal
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
777 quax742 quantize -0.10E-999 1e-1000 -> -1E-1000 Subnormal Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
778 quax743 quantize -0.100E-999 1e-1000 -> -1E-1000 Subnormal Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
779 quax744 quantize -0.01E-999 1e-1000 -> -0E-1000 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
780 -- next is rounded to Emin
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
781 quax745 quantize -0.999E-999 1e-1000 -> -1.0E-999 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
782 quax746 quantize -0.099E-999 1e-1000 -> -1E-1000 Inexact Rounded Subnormal
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
783 quax747 quantize -0.009E-999 1e-1000 -> -0E-1000 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
784 quax748 quantize -0.001E-999 1e-1000 -> -0E-1000 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
785 quax749 quantize -0.0001E-999 1e-1000 -> -0E-1000 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
786
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
787 quax750 quantize -1.00E-999 1e-1001 -> -1.00E-999
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
788 quax751 quantize -0.1E-999 1e-1001 -> -1.0E-1000 Subnormal
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
789 quax752 quantize -0.10E-999 1e-1001 -> -1.0E-1000 Subnormal
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
790 quax753 quantize -0.100E-999 1e-1001 -> -1.0E-1000 Subnormal Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
791 quax754 quantize -0.01E-999 1e-1001 -> -1E-1001 Subnormal
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
792 -- next is rounded to Emin
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
793 quax755 quantize -0.999E-999 1e-1001 -> -1.00E-999 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
794 quax756 quantize -0.099E-999 1e-1001 -> -1.0E-1000 Inexact Rounded Subnormal
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
795 quax757 quantize -0.009E-999 1e-1001 -> -1E-1001 Inexact Rounded Subnormal
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
796 quax758 quantize -0.001E-999 1e-1001 -> -0E-1001 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
797 quax759 quantize -0.0001E-999 1e-1001 -> -0E-1001 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
798
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
799 quax760 quantize -1.00E-999 1e-1002 -> -1.000E-999
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
800 quax761 quantize -0.1E-999 1e-1002 -> -1.00E-1000 Subnormal
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
801 quax762 quantize -0.10E-999 1e-1002 -> -1.00E-1000 Subnormal
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
802 quax763 quantize -0.100E-999 1e-1002 -> -1.00E-1000 Subnormal
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
803 quax764 quantize -0.01E-999 1e-1002 -> -1.0E-1001 Subnormal
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
804 quax765 quantize -0.999E-999 1e-1002 -> -9.99E-1000 Subnormal
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
805 quax766 quantize -0.099E-999 1e-1002 -> -9.9E-1001 Subnormal
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
806 quax767 quantize -0.009E-999 1e-1002 -> -9E-1002 Subnormal
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
807 quax768 quantize -0.001E-999 1e-1002 -> -1E-1002 Subnormal
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
808 quax769 quantize -0.0001E-999 1e-1002 -> -0E-1002 Inexact Rounded
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
809
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
810 -- rhs must be no less than Etiny
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
811 quax770 quantize -1.00E-999 1e-1003 -> NaN Invalid_operation
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
812 quax771 quantize -0.1E-999 1e-1003 -> NaN Invalid_operation
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
813 quax772 quantize -0.10E-999 1e-1003 -> NaN Invalid_operation
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
814 quax773 quantize -0.100E-999 1e-1003 -> NaN Invalid_operation
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
815 quax774 quantize -0.01E-999 1e-1003 -> NaN Invalid_operation
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
816 quax775 quantize -0.999E-999 1e-1003 -> NaN Invalid_operation
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
817 quax776 quantize -0.099E-999 1e-1003 -> NaN Invalid_operation
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
818 quax777 quantize -0.009E-999 1e-1003 -> NaN Invalid_operation
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
819 quax778 quantize -0.001E-999 1e-1003 -> NaN Invalid_operation
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
820 quax779 quantize -0.0001E-999 1e-1003 -> NaN Invalid_operation
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
821 quax780 quantize -0.0001E-999 1e-1004 -> NaN Invalid_operation
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
822
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
823 precision: 9
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
824 maxExponent: 999999999
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
825 minexponent: -999999999
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
826
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
827 -- some extremes derived from Rescale testcases
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
828 quax801 quantize 0 1e1000000000 -> NaN Invalid_operation
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
829 quax802 quantize 0 1e-1000000000 -> 0E-1000000000
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
830 quax803 quantize 0 1e2000000000 -> NaN Invalid_operation
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
831 quax804 quantize 0 1e-2000000000 -> NaN Invalid_operation
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
832 quax805 quantize 0 1e3000000000 -> NaN Invalid_operation
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
833 quax806 quantize 0 1e-3000000000 -> NaN Invalid_operation
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
834 quax807 quantize 0 1e4000000000 -> NaN Invalid_operation
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
835 quax808 quantize 0 1e-4000000000 -> NaN Invalid_operation
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
836 quax809 quantize 0 1e5000000000 -> NaN Invalid_operation
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
837 quax810 quantize 0 1e-5000000000 -> NaN Invalid_operation
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
838 quax811 quantize 0 1e6000000000 -> NaN Invalid_operation
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
839 quax812 quantize 0 1e-6000000000 -> NaN Invalid_operation
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
840 quax813 quantize 0 1e7000000000 -> NaN Invalid_operation
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
841 quax814 quantize 0 1e-7000000000 -> NaN Invalid_operation
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
842 quax815 quantize 0 1e8000000000 -> NaN Invalid_operation
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
843 quax816 quantize 0 1e-8000000000 -> NaN Invalid_operation
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
844 quax817 quantize 0 1e9000000000 -> NaN Invalid_operation
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
845 quax818 quantize 0 1e-9000000000 -> NaN Invalid_operation
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
846 quax819 quantize 0 1e9999999999 -> NaN Invalid_operation
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
847 quax820 quantize 0 1e-9999999999 -> NaN Invalid_operation
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
848 quax821 quantize 0 1e10000000000 -> NaN Invalid_operation
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
849 quax822 quantize 0 1e-10000000000 -> NaN Invalid_operation
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
850
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
851 quax843 quantize 0 1e999999999 -> 0E+999999999
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
852 quax844 quantize 0 1e1000000000 -> NaN Invalid_operation
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
853 quax845 quantize 0 1e-999999999 -> 0E-999999999
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
854 quax846 quantize 0 1e-1000000000 -> 0E-1000000000
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
855 quax847 quantize 0 1e-1000000001 -> 0E-1000000001
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
856 quax848 quantize 0 1e-1000000002 -> 0E-1000000002
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
857 quax849 quantize 0 1e-1000000003 -> 0E-1000000003
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
858 quax850 quantize 0 1e-1000000004 -> 0E-1000000004
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
859 quax851 quantize 0 1e-1000000005 -> 0E-1000000005
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
860 quax852 quantize 0 1e-1000000006 -> 0E-1000000006
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
861 quax853 quantize 0 1e-1000000007 -> 0E-1000000007
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
862 quax854 quantize 0 1e-1000000008 -> NaN Invalid_operation
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
863
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
864 quax861 quantize 1 1e+2147483649 -> NaN Invalid_operation
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
865 quax862 quantize 1 1e+2147483648 -> NaN Invalid_operation
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
866 quax863 quantize 1 1e+2147483647 -> NaN Invalid_operation
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
867 quax864 quantize 1 1e-2147483647 -> NaN Invalid_operation
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
868 quax865 quantize 1 1e-2147483648 -> NaN Invalid_operation
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
869 quax866 quantize 1 1e-2147483649 -> NaN Invalid_operation
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
870
44600
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
871 -- More from Fung Lee
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
872 precision: 16
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
873 rounding: half_up
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
874 maxExponent: 384
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
875 minExponent: -383
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
876 quax1021 quantize 8.666666666666000E+384 1.000000000000000E+384 -> 8.666666666666000E+384
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
877 quax1022 quantize 64#8.666666666666000E+384 64#1.000000000000000E+384 -> 8.666666666666000E+384
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
878 quax1023 quantize 64#8.666666666666000E+384 128#1.000000000000000E+384 -> 8.666666666666000E+384
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
879 quax1024 quantize 64#8.666666666666000E+384 64#1E+384 -> 8.666666666666000E+384
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
880 quax1025 quantize 64#8.666666666666000E+384 64#1E+384 -> 64#8.666666666666000E+384
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
881 quax1026 quantize 64#8.666666666666000E+384 128#1E+384 -> 64#9E+384 Inexact Rounded Clamped
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
882 quax1027 quantize 64#8.666666666666000E+323 64#1E+31 -> NaN Invalid_operation
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
883 quax1028 quantize 64#8.666666666666000E+323 128#1E+31 -> NaN Invalid_operation
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
884 quax1029 quantize 64#8.66666666E+3 128#1E+10 -> 64#0E10 Inexact Rounded
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
885 quax1030 quantize 8.66666666E+3 1E+3 -> 9E+3 Inexact Rounded
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
886
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
887 -- Int and uInt32 edge values for testing conversions
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
888 quax1040 quantize -2147483646 0 -> -2147483646
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
889 quax1041 quantize -2147483647 0 -> -2147483647
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
890 quax1042 quantize -2147483648 0 -> -2147483648
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
891 quax1043 quantize -2147483649 0 -> -2147483649
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
892 quax1044 quantize 2147483646 0 -> 2147483646
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
893 quax1045 quantize 2147483647 0 -> 2147483647
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
894 quax1046 quantize 2147483648 0 -> 2147483648
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
895 quax1047 quantize 2147483649 0 -> 2147483649
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
896 quax1048 quantize 4294967294 0 -> 4294967294
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
897 quax1049 quantize 4294967295 0 -> 4294967295
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
898 quax1050 quantize 4294967296 0 -> 4294967296
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
899 quax1051 quantize 4294967297 0 -> 4294967297
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
900 -- and powers of ten for same
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
901 quax1101 quantize 5000000000 0 -> 5000000000
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
902 quax1102 quantize 4000000000 0 -> 4000000000
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
903 quax1103 quantize 2000000000 0 -> 2000000000
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
904 quax1104 quantize 1000000000 0 -> 1000000000
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
905 quax1105 quantize 0100000000 0 -> 100000000
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
906 quax1106 quantize 0010000000 0 -> 10000000
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
907 quax1107 quantize 0001000000 0 -> 1000000
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
908 quax1108 quantize 0000100000 0 -> 100000
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
909 quax1109 quantize 0000010000 0 -> 10000
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
910 quax1110 quantize 0000001000 0 -> 1000
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
911 quax1111 quantize 0000000100 0 -> 100
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
912 quax1112 quantize 0000000010 0 -> 10
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
913 quax1113 quantize 0000000001 0 -> 1
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
914 quax1114 quantize 0000000000 0 -> 0
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
915 -- and powers of ten for same
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
916 quax1121 quantize -5000000000 0 -> -5000000000
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
917 quax1122 quantize -4000000000 0 -> -4000000000
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
918 quax1123 quantize -2000000000 0 -> -2000000000
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
919 quax1124 quantize -1000000000 0 -> -1000000000
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
920 quax1125 quantize -0100000000 0 -> -100000000
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
921 quax1126 quantize -0010000000 0 -> -10000000
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
922 quax1127 quantize -0001000000 0 -> -1000000
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
923 quax1128 quantize -0000100000 0 -> -100000
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
924 quax1129 quantize -0000010000 0 -> -10000
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
925 quax1130 quantize -0000001000 0 -> -1000
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
926 quax1131 quantize -0000000100 0 -> -100
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
927 quax1132 quantize -0000000010 0 -> -10
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
928 quax1133 quantize -0000000001 0 -> -1
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
929 quax1134 quantize -0000000000 0 -> -0
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
930
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
931 -- Some miscellany
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
932 precision: 34
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
933 rounding: half_up
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
934 maxExponent: 6144
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
935 minExponent: -6143
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
936 -- 1 2 3
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
937 -- 1 234567890123456789012345678901234
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
938 quax0a1 quantize 8.555555555555555555555555555555555E+6143 1E+6143 -> 9E+6143 Inexact Rounded
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
939 quax0a2 quantize 128#8.555555555555555555555555555555555E+6143 128#1E+6143 -> 8.55555555555555555555555555555556E+6143 Rounded Inexact
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
940 quax0a3 quantize 128#8.555555555555555555555555555555555E+6144 128#1E+6144 -> 8.555555555555555555555555555555555E+6144
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
941
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
942 -- payload decapitate
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
943 precision: 5
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
944 quax62100 quantize 11 -sNaN1234567890 -> -NaN67890 Invalid_operation
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
945
32451
d2c1c7ae7cf4 Move Decimal from the sandbox into production.
Raymond Hettinger <python@rcn.com>
parents:
diff changeset
946 -- Null tests
44600
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
947 quax998 quantize 10 # -> NaN Invalid_operation
9a60bd8f00d6 Decimal module and test cases were updated to their state of
Facundo Batista <facundobatista@gmail.com>
parents: 33158
diff changeset
948 quax999 quantize # 1e10 -> NaN Invalid_operation