]> git.proxmox.com Git - mirror_edk2.git/blame - AppPkg/Applications/Python/Python-2.7.2/Lib/test/decimaltestdata/tointegralx.decTest
AppPkg/Applications/Python: Add Python 2.7.2 sources since the release of Python...
[mirror_edk2.git] / AppPkg / Applications / Python / Python-2.7.2 / Lib / test / decimaltestdata / tointegralx.decTest
CommitLineData
4710c53d 1------------------------------------------------------------------------\r
2-- tointegralx.decTest -- round decimal to integral value, exact --\r
3-- Copyright (c) IBM Corporation, 2001, 2008. All rights reserved. --\r
4------------------------------------------------------------------------\r
5-- Please see the document "General Decimal Arithmetic Testcases" --\r
6-- at http://www2.hursley.ibm.com/decimal for the description of --\r
7-- these testcases. --\r
8-- --\r
9-- These testcases are experimental ('beta' versions), and they --\r
10-- may contain errors. They are offered on an as-is basis. In --\r
11-- particular, achieving the same results as the tests here is not --\r
12-- a guarantee that an implementation complies with any Standard --\r
13-- or specification. The tests are not exhaustive. --\r
14-- --\r
15-- Please send comments, suggestions, and corrections to the author: --\r
16-- Mike Cowlishaw, IBM Fellow --\r
17-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --\r
18-- mfc@uk.ibm.com --\r
19------------------------------------------------------------------------\r
20version: 2.59\r
21\r
22-- This set of tests tests the extended specification 'round-to-integral\r
23-- value' operation (from IEEE 854, later modified in 754r).\r
24-- All non-zero results are defined as being those from either copy or\r
25-- quantize, so those are assumed to have been tested.\r
26\r
27-- This tests toIntegraExact, which may set Inexact\r
28\r
29extended: 1\r
30precision: 9\r
31rounding: half_up\r
32maxExponent: 999\r
33minExponent: -999\r
34\r
35intxx001 tointegralx 0 -> 0\r
36intxx002 tointegralx 0.0 -> 0\r
37intxx003 tointegralx 0.1 -> 0 Inexact Rounded\r
38intxx004 tointegralx 0.2 -> 0 Inexact Rounded\r
39intxx005 tointegralx 0.3 -> 0 Inexact Rounded\r
40intxx006 tointegralx 0.4 -> 0 Inexact Rounded\r
41intxx007 tointegralx 0.5 -> 1 Inexact Rounded\r
42intxx008 tointegralx 0.6 -> 1 Inexact Rounded\r
43intxx009 tointegralx 0.7 -> 1 Inexact Rounded\r
44intxx010 tointegralx 0.8 -> 1 Inexact Rounded\r
45intxx011 tointegralx 0.9 -> 1 Inexact Rounded\r
46intxx012 tointegralx 1 -> 1\r
47intxx013 tointegralx 1.0 -> 1 Rounded\r
48intxx014 tointegralx 1.1 -> 1 Inexact Rounded\r
49intxx015 tointegralx 1.2 -> 1 Inexact Rounded\r
50intxx016 tointegralx 1.3 -> 1 Inexact Rounded\r
51intxx017 tointegralx 1.4 -> 1 Inexact Rounded\r
52intxx018 tointegralx 1.5 -> 2 Inexact Rounded\r
53intxx019 tointegralx 1.6 -> 2 Inexact Rounded\r
54intxx020 tointegralx 1.7 -> 2 Inexact Rounded\r
55intxx021 tointegralx 1.8 -> 2 Inexact Rounded\r
56intxx022 tointegralx 1.9 -> 2 Inexact Rounded\r
57-- negatives\r
58intxx031 tointegralx -0 -> -0\r
59intxx032 tointegralx -0.0 -> -0\r
60intxx033 tointegralx -0.1 -> -0 Inexact Rounded\r
61intxx034 tointegralx -0.2 -> -0 Inexact Rounded\r
62intxx035 tointegralx -0.3 -> -0 Inexact Rounded\r
63intxx036 tointegralx -0.4 -> -0 Inexact Rounded\r
64intxx037 tointegralx -0.5 -> -1 Inexact Rounded\r
65intxx038 tointegralx -0.6 -> -1 Inexact Rounded\r
66intxx039 tointegralx -0.7 -> -1 Inexact Rounded\r
67intxx040 tointegralx -0.8 -> -1 Inexact Rounded\r
68intxx041 tointegralx -0.9 -> -1 Inexact Rounded\r
69intxx042 tointegralx -1 -> -1\r
70intxx043 tointegralx -1.0 -> -1 Rounded\r
71intxx044 tointegralx -1.1 -> -1 Inexact Rounded\r
72intxx045 tointegralx -1.2 -> -1 Inexact Rounded\r
73intxx046 tointegralx -1.3 -> -1 Inexact Rounded\r
74intxx047 tointegralx -1.4 -> -1 Inexact Rounded\r
75intxx048 tointegralx -1.5 -> -2 Inexact Rounded\r
76intxx049 tointegralx -1.6 -> -2 Inexact Rounded\r
77intxx050 tointegralx -1.7 -> -2 Inexact Rounded\r
78intxx051 tointegralx -1.8 -> -2 Inexact Rounded\r
79intxx052 tointegralx -1.9 -> -2 Inexact Rounded\r
80-- next two would be NaN using quantize(x, 0)\r
81intxx053 tointegralx 10E+30 -> 1.0E+31\r
82intxx054 tointegralx -10E+30 -> -1.0E+31\r
83\r
84-- numbers around precision\r
85precision: 9\r
86intxx060 tointegralx '56267E-10' -> '0' Inexact Rounded\r
87intxx061 tointegralx '56267E-5' -> '1' Inexact Rounded\r
88intxx062 tointegralx '56267E-2' -> '563' Inexact Rounded\r
89intxx063 tointegralx '56267E-1' -> '5627' Inexact Rounded\r
90intxx065 tointegralx '56267E-0' -> '56267'\r
91intxx066 tointegralx '56267E+0' -> '56267'\r
92intxx067 tointegralx '56267E+1' -> '5.6267E+5'\r
93intxx068 tointegralx '56267E+2' -> '5.6267E+6'\r
94intxx069 tointegralx '56267E+3' -> '5.6267E+7'\r
95intxx070 tointegralx '56267E+4' -> '5.6267E+8'\r
96intxx071 tointegralx '56267E+5' -> '5.6267E+9'\r
97intxx072 tointegralx '56267E+6' -> '5.6267E+10'\r
98intxx073 tointegralx '1.23E+96' -> '1.23E+96'\r
99intxx074 tointegralx '1.23E+384' -> '1.23E+384'\r
100intxx075 tointegralx '1.23E+999' -> '1.23E+999'\r
101\r
102intxx080 tointegralx '-56267E-10' -> '-0' Inexact Rounded\r
103intxx081 tointegralx '-56267E-5' -> '-1' Inexact Rounded\r
104intxx082 tointegralx '-56267E-2' -> '-563' Inexact Rounded\r
105intxx083 tointegralx '-56267E-1' -> '-5627' Inexact Rounded\r
106intxx085 tointegralx '-56267E-0' -> '-56267'\r
107intxx086 tointegralx '-56267E+0' -> '-56267'\r
108intxx087 tointegralx '-56267E+1' -> '-5.6267E+5'\r
109intxx088 tointegralx '-56267E+2' -> '-5.6267E+6'\r
110intxx089 tointegralx '-56267E+3' -> '-5.6267E+7'\r
111intxx090 tointegralx '-56267E+4' -> '-5.6267E+8'\r
112intxx091 tointegralx '-56267E+5' -> '-5.6267E+9'\r
113intxx092 tointegralx '-56267E+6' -> '-5.6267E+10'\r
114intxx093 tointegralx '-1.23E+96' -> '-1.23E+96'\r
115intxx094 tointegralx '-1.23E+384' -> '-1.23E+384'\r
116intxx095 tointegralx '-1.23E+999' -> '-1.23E+999'\r
117\r
118-- subnormal inputs\r
119intxx100 tointegralx 1E-999 -> 0 Inexact Rounded\r
120intxx101 tointegralx 0.1E-999 -> 0 Inexact Rounded\r
121intxx102 tointegralx 0.01E-999 -> 0 Inexact Rounded\r
122intxx103 tointegralx 0E-999 -> 0\r
123\r
124-- specials and zeros\r
125intxx120 tointegralx 'Inf' -> Infinity\r
126intxx121 tointegralx '-Inf' -> -Infinity\r
127intxx122 tointegralx NaN -> NaN\r
128intxx123 tointegralx sNaN -> NaN Invalid_operation\r
129intxx124 tointegralx 0 -> 0\r
130intxx125 tointegralx -0 -> -0\r
131intxx126 tointegralx 0.000 -> 0\r
132intxx127 tointegralx 0.00 -> 0\r
133intxx128 tointegralx 0.0 -> 0\r
134intxx129 tointegralx 0 -> 0\r
135intxx130 tointegralx 0E-3 -> 0\r
136intxx131 tointegralx 0E-2 -> 0\r
137intxx132 tointegralx 0E-1 -> 0\r
138intxx133 tointegralx 0E-0 -> 0\r
139intxx134 tointegralx 0E+1 -> 0E+1\r
140intxx135 tointegralx 0E+2 -> 0E+2\r
141intxx136 tointegralx 0E+3 -> 0E+3\r
142intxx137 tointegralx 0E+4 -> 0E+4\r
143intxx138 tointegralx 0E+5 -> 0E+5\r
144intxx139 tointegralx -0.000 -> -0\r
145intxx140 tointegralx -0.00 -> -0\r
146intxx141 tointegralx -0.0 -> -0\r
147intxx142 tointegralx -0 -> -0\r
148intxx143 tointegralx -0E-3 -> -0\r
149intxx144 tointegralx -0E-2 -> -0\r
150intxx145 tointegralx -0E-1 -> -0\r
151intxx146 tointegralx -0E-0 -> -0\r
152intxx147 tointegralx -0E+1 -> -0E+1\r
153intxx148 tointegralx -0E+2 -> -0E+2\r
154intxx149 tointegralx -0E+3 -> -0E+3\r
155intxx150 tointegralx -0E+4 -> -0E+4\r
156intxx151 tointegralx -0E+5 -> -0E+5\r
157-- propagating NaNs\r
158intxx152 tointegralx NaN808 -> NaN808\r
159intxx153 tointegralx sNaN080 -> NaN80 Invalid_operation\r
160intxx154 tointegralx -NaN808 -> -NaN808\r
161intxx155 tointegralx -sNaN080 -> -NaN80 Invalid_operation\r
162intxx156 tointegralx -NaN -> -NaN\r
163intxx157 tointegralx -sNaN -> -NaN Invalid_operation\r
164\r
165-- examples\r
166rounding: half_up\r
167precision: 9\r
168intxx200 tointegralx 2.1 -> 2 Inexact Rounded\r
169intxx201 tointegralx 100 -> 100\r
170intxx202 tointegralx 100.0 -> 100 Rounded\r
171intxx203 tointegralx 101.5 -> 102 Inexact Rounded\r
172intxx204 tointegralx -101.5 -> -102 Inexact Rounded\r
173intxx205 tointegralx 10E+5 -> 1.0E+6\r
174intxx206 tointegralx 7.89E+77 -> 7.89E+77\r
175intxx207 tointegralx -Inf -> -Infinity\r
176\r
177\r
178-- all rounding modes\r
179rounding: half_even\r
180\r
181intxx210 tointegralx 55.5 -> 56 Inexact Rounded\r
182intxx211 tointegralx 56.5 -> 56 Inexact Rounded\r
183intxx212 tointegralx 57.5 -> 58 Inexact Rounded\r
184intxx213 tointegralx -55.5 -> -56 Inexact Rounded\r
185intxx214 tointegralx -56.5 -> -56 Inexact Rounded\r
186intxx215 tointegralx -57.5 -> -58 Inexact Rounded\r
187\r
188rounding: half_up\r
189\r
190intxx220 tointegralx 55.5 -> 56 Inexact Rounded\r
191intxx221 tointegralx 56.5 -> 57 Inexact Rounded\r
192intxx222 tointegralx 57.5 -> 58 Inexact Rounded\r
193intxx223 tointegralx -55.5 -> -56 Inexact Rounded\r
194intxx224 tointegralx -56.5 -> -57 Inexact Rounded\r
195intxx225 tointegralx -57.5 -> -58 Inexact Rounded\r
196\r
197rounding: half_down\r
198\r
199intxx230 tointegralx 55.5 -> 55 Inexact Rounded\r
200intxx231 tointegralx 56.5 -> 56 Inexact Rounded\r
201intxx232 tointegralx 57.5 -> 57 Inexact Rounded\r
202intxx233 tointegralx -55.5 -> -55 Inexact Rounded\r
203intxx234 tointegralx -56.5 -> -56 Inexact Rounded\r
204intxx235 tointegralx -57.5 -> -57 Inexact Rounded\r
205\r
206rounding: up\r
207\r
208intxx240 tointegralx 55.3 -> 56 Inexact Rounded\r
209intxx241 tointegralx 56.3 -> 57 Inexact Rounded\r
210intxx242 tointegralx 57.3 -> 58 Inexact Rounded\r
211intxx243 tointegralx -55.3 -> -56 Inexact Rounded\r
212intxx244 tointegralx -56.3 -> -57 Inexact Rounded\r
213intxx245 tointegralx -57.3 -> -58 Inexact Rounded\r
214\r
215rounding: down\r
216\r
217intxx250 tointegralx 55.7 -> 55 Inexact Rounded\r
218intxx251 tointegralx 56.7 -> 56 Inexact Rounded\r
219intxx252 tointegralx 57.7 -> 57 Inexact Rounded\r
220intxx253 tointegralx -55.7 -> -55 Inexact Rounded\r
221intxx254 tointegralx -56.7 -> -56 Inexact Rounded\r
222intxx255 tointegralx -57.7 -> -57 Inexact Rounded\r
223\r
224rounding: ceiling\r
225\r
226intxx260 tointegralx 55.3 -> 56 Inexact Rounded\r
227intxx261 tointegralx 56.3 -> 57 Inexact Rounded\r
228intxx262 tointegralx 57.3 -> 58 Inexact Rounded\r
229intxx263 tointegralx -55.3 -> -55 Inexact Rounded\r
230intxx264 tointegralx -56.3 -> -56 Inexact Rounded\r
231intxx265 tointegralx -57.3 -> -57 Inexact Rounded\r
232\r
233rounding: floor\r
234\r
235intxx270 tointegralx 55.7 -> 55 Inexact Rounded\r
236intxx271 tointegralx 56.7 -> 56 Inexact Rounded\r
237intxx272 tointegralx 57.7 -> 57 Inexact Rounded\r
238intxx273 tointegralx -55.7 -> -56 Inexact Rounded\r
239intxx274 tointegralx -56.7 -> -57 Inexact Rounded\r
240intxx275 tointegralx -57.7 -> -58 Inexact Rounded\r
241\r
242-- Int and uInt32 edge values for testing conversions\r
243precision: 16\r
244intxx300 tointegralx -2147483646 -> -2147483646\r
245intxx301 tointegralx -2147483647 -> -2147483647\r
246intxx302 tointegralx -2147483648 -> -2147483648\r
247intxx303 tointegralx -2147483649 -> -2147483649\r
248intxx304 tointegralx 2147483646 -> 2147483646\r
249intxx305 tointegralx 2147483647 -> 2147483647\r
250intxx306 tointegralx 2147483648 -> 2147483648\r
251intxx307 tointegralx 2147483649 -> 2147483649\r
252intxx308 tointegralx 4294967294 -> 4294967294\r
253intxx309 tointegralx 4294967295 -> 4294967295\r
254intxx310 tointegralx 4294967296 -> 4294967296\r
255intxx311 tointegralx 4294967297 -> 4294967297\r