File: cov.decTest

package info (click to toggle)
mpdecimal 4.0.1-5
  • links: PTS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,232 kB
  • sloc: ansic: 17,917; cpp: 6,508; sh: 4,236; makefile: 621; lisp: 502; python: 85; asm: 18
file content (277 lines) | stat: -rw-r--r-- 11,462 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
-- Selected test cases to reduce both the archive size and runtime.  For the
-- large test suite, download the separate mpdecimal-testdata distribution and
-- replace the testdata_dist directory.

rounding: half_even
precision: 28
maxexponent: 999999999
minexponent: -999999999
clamp: 0

covx5000 power 0 123456789123456789123456789 -> 0
covx5001 power 1 123456789123456789123456789 -> 1
covx5004 power 1.0000000000000 123456789123456789123456789 -> 1.000000000000000000000000000 Rounded
covx5008 power 1.000000001 12345676891234567891 -> Infinity  Rounded Inexact Overflow
covx5010 power 1.000000001 -12345676891234567891 -> 0E-1000000026  Rounded Underflow Inexact Clamped Subnormal

rounding: down
covx5011 power 2.2 123456789123456789123456788 -> 9.999999999999999999999999999E+999999999 Rounded Inexact Overflow

rounding: down
covx5012 power 2.2 2921000000.891239129 -> 9.999999999999999999999999999E+999999999 Rounded Inexact Overflow

rounding: half_even
precision: 5000
covx5025 exp 1e20 -> Infinity  Rounded Inexact Overflow

rounding: half_even
precision: 5000
covx5026 exp -1e20 -> 0E-1000004998  Rounded Subnormal Clamped Underflow Inexact

rounding: down
precision: 4
maxexponent: 4
minexponent: -4
covx5027 ln 1.000000000000000000001 -> 0E-7 Subnormal Inexact Clamped Underflow Rounded
covx5028 ln 1e999999999 -> Infinity Inexact Overflow Rounded

rounding: half_even
precision: 1
maxexponent: 1
minexponent: -1
covx5029 log10 1.000000000000000000001 -> 0.0 Subnormal Inexact Clamped Underflow Rounded

rounding: half_even
covx5030 log10 12345e100 -> Infinity Inexact Overflow Rounded

rounding: half_up
precision: 28
maxexponent: 999999999
minexponent: -999999999
covx5031 log10 177.82794100389228012254211972400046751027254035861481049206983723942104337400734839183756638300367799 -> 2.250000000000000000000000001  Inexact Rounded

rounding: half_even
precision: 10000
covx5034 rotate 1234 12345678901234567890 -> NaN Invalid_operation

rounding: half_up
precision: 24
maxexponent: 999999999
minexponent: -999999999
covx5048 remaindernear  999999999999999999999999.5   1  -> NaN Division_impossible
covx5051 remaindernear  999999999999999999999998.5   1  -> 0.5

rounding: half_even
precision: 28
maxexponent: 99
minexponent: -99
covx5056 apply 9999999999999999999999999999E-127 -> 1.000000000000000000000000000E-99  Underflow Subnormal Rounded Inexact
covx5057 quantize 9999999999999999999999999999e71 1e72 -> 1.000000000000000000000000000E+99 Rounded Inexact

rounding: half_even
precision: 58
maxexponent: 99
minexponent: -99
covx5058 apply 999999999999999999999999999999999999999999999999E-159 -> 1.000000000000000000000000000000000000000000000E-111  Underflow Subnormal Rounded Inexact
covx5059 quantize 999999999999999999999999999999999999999999999999e51 1e52 -> 1.00000000000000000000000000000000000000000000000E+99 Rounded Inexact

covx5060 tointegralx 999999999999999999999999999999999999999999999.9 -> 1000000000000000000000000000000000000000000000  Inexact Rounded
covx5061 tointegralx 9999999999999999999999999999999999999999999999999999999999999999999999999999.9 -> 10000000000000000000000000000000000000000000000000000000000000000000000000000  Inexact Rounded

rounding: half_even
precision: 2000
maxexponent: 999999999
minexponent: -999999999

covx5071 quantize 9999999999999999999999999999999999999999999999999999999999 1e1 -> 1.000000000000000000000000000000000000000000000000000000000E+58  Rounded Inexact
covx5072 and  100000010010011000000000000000000000000101001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000001000000000000 1081000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000010101000000000000000000000000000000000000000000000000000000000000000000000000000000100001010010100000100101010000101000100000100101000100100000010001010010000000000000000000000000000000000010101001010000000000000000000000000000000000000000001 ->  NaN Invalid_operation
covx5073 invert  1081000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000010101000000000000000000000000000000000000000000000000000000000000000000000000000000100001010010100000100101010000101000100000100101000100100000010001010010000000000000000000000000000000000010101001010000000000000000000000000000000000000000001 ->  NaN Invalid_operation
covx5074 or  100000010010011000000000000000000000000101001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000001000000000000 1081000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000010101000000000000000000000000000000000000000000000000000000000000000000000000000000100001010010100000100101010000101000100000100101000100100000010001010010000000000000000000000000000000000010101001010000000000000000000000000000000000000000001 ->  NaN Invalid_operation
covx5075 xor  100000010010011000000000000000000000000101001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000001000000000000 1081000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000010101000000000000000000000000000000000000000000000000000000000000000000000000000000100001010010100000100101010000101000100000100101000100100000010001010010000000000000000000000000000000000010101001010000000000000000000000000000000000000000001 ->  NaN Invalid_operation

rounding: half_even
precision: 28
covx5076 shift  123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789  -20   -> 91234567

rounding: half_even
precision: 80
covx5077 reduce 9892345673.0123456780000000000000000000000000000000000000000000000000000000000000000000000 -> 9892345673.012345678  Rounded

rounding: down
precision: 28
covx5078 resc Infinity 425000000 -> Infinity
covx50780 resc NaN 425000000 -> NaN
covx50782 resc sNaN 425000000 -> sNaN
covx50783 resc 0 425000000 -> 0E+425000000

cov64x50784 resc 1e999999999999999999 -1000 -> NaN Invalid_operation
cov32x50785 resc 1e425000000 -1000 -> NaN Invalid_operation

rounding: half_even
precision: 58
maxexponent: 99
minexponent: -99
covx5079 resc 999999999e200 100 -> 9.999999990000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000E+208

rounding: half_even
covx5080 resc 999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999e100 120 -> 1.0000000000000000000000000000000000000000000000000000000000000000000000E+190  Inexact Rounded

rounding: half_even
precision: 58
maxexponent: 999
minexponent: -999
covx5081 resc 1E-1000 -1005 -> 1.00000E-1000 Subnormal

-- extreme cases for NaN payloads
maxexponent: 1
minexponent: -1
precision: 1
clamp: 1
covx5082 plus NaN123 -> NaN
covx5083 plus NaN0 -> NaN

-- decapitating leads to NaN0 => NaN
maxexponent: 999
minexponent: -999
precision: 6
covx5084 plus NaN123000000 -> NaN
covx5085 plus NaN12300000 -> NaN
covx5086 plus NaN1230000 -> NaN30000

clamp: 0
covx5087 plus NaN123000000 -> NaN
covx5088 plus NaN12300000 -> NaN300000
covx5089 plus NaN1230000 -> NaN230000


-- floor, ceil, trunc
rounding: half_even
precision: 2000
maxexponent: 999
minexponent: -999
clamp: 0

floor10000 floor 0 -> 0
floor10001 floor 0.0 -> 0
floor10002 floor -0.0 -> -0
floor10003 floor 1e-200 -> 0
floor10004 floor -1e-200 -> -1
floor10005 floor 0.5 -> 0
floor10006 floor -0.5 -> -1
floor10007 floor 0.999999999999 -> 0
floor10008 floor -0.99999999999 -> -1
floor10009 floor -1.0 -> -1
floor10010 floor 1.0 -> 1
floor10011 floor 9.9 -> 9
floor10012 floor -9.9 -> -10
floor10013 floor 9.333e+80 -> 9.333E+80
floor10014 floor -9.333e+80 -> -9.333E+80
floor10015 floor 100.0 -> 100
floor10016 floor -100.0 -> -100
ceil10017 ceil 0 -> 0
ceil10018 ceil 0.0 -> 0
ceil10019 ceil -0.0 -> -0
ceil10020 ceil 1e-200 -> 1
ceil10021 ceil -1e-200 -> -0
ceil10022 ceil 0.5 -> 1
ceil10023 ceil -0.5 -> -0
ceil10024 ceil 0.999999999999 -> 1
ceil10025 ceil -0.99999999999 -> -0
ceil10026 ceil -1.0 -> -1
ceil10027 ceil 1.0 -> 1
ceil10028 ceil 9.9 -> 10
ceil10029 ceil -9.9 -> -9
ceil10030 ceil 9.333e+80 -> 9.333E+80
ceil10031 ceil -9.333e+80 -> -9.333E+80
ceil10032 ceil 100.0 -> 100
ceil10033 ceil -100.0 -> -100
trunc10034 trunc 0 -> 0
trunc10035 trunc 0.0 -> 0
trunc10036 trunc -0.0 -> -0
trunc10037 trunc 1e-200 -> 0
trunc10038 trunc -1e-200 -> -0
trunc10039 trunc 0.5 -> 0
trunc10040 trunc -0.5 -> -0
trunc10041 trunc 0.999999999999 -> 0
trunc10042 trunc -0.99999999999 -> -0
trunc10043 trunc -1.0 -> -1
trunc10044 trunc 1.0 -> 1
trunc10045 trunc 9.9 -> 9
trunc10046 trunc -9.9 -> -9
trunc10047 trunc 9.333e+80 -> 9.333E+80
trunc10048 trunc -9.333e+80 -> -9.333E+80
trunc10049 trunc 100.0 -> 100
trunc10050 trunc -100.0 -> -100

-- negative etop: trigger allocation failure in mpd_qshiftl.
maxexponent: 50
minexponent: -50
precision: 100
clamp: 1
etop10051 apply 1e+50 -> 100000000000000000000000000000000000000000000000000.0000000000000000000000000000000000000000000000000 Clamped

-- test mpd_qln10().

lnX10052 ln10 1 -> 2 Rounded Inexact
lnX10053 ln10 51 -> 2.30258509299404568401799145468436420760110148862877 Rounded Inexact
lnX10054 ln10 101 -> 2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983 Rounded Inexact

precision: 4
rounding: floor
maxExponent: 4
minExponent: -4
clamp: 0

covx10101 divide 99960 -8.4E+2 -> -119.0

-- ExtendedRange==0 disables the allcr=0 tests.

ExtendedRange: 0

Precision: 119
MaxExponent: 425000000
MinExponent: -425000000
Rounding: Half_even
Clamp: 0
gen14398 exp '-978598892.4783936221181690860' -> '1.0000000000000000000E-425000099' Inexact Rounded Subnormal Underflow

precision: 21
MaxExponent: 2100
MinExponent: -2100

expx10001: exp -4835.428695287495936437782054837164835962313126120423249669988592031902480322440208495594130688156427 -> 1.00000000000000000000E-2100 Rounded Inexact Subnormal Underflow

precision: 21
rounding: Up
MaxExponent: 2100
MinExponent: -55
clamp: 0

lnx10001 ln 1.0000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000025 -> 1.00000000000000000000E-55 Rounded Inexact Subnormal Underflow

precision: 43
rounding: Up
MaxExponent: 784
MinExponent: -101
clamp: 1

lnx10002 ln 1.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001 -> 1.000000000000000000000000000000000000000000E-101 Rounded Inexact

precision: 7
rounding: Up
MaxExponent: 96
MinExponent: -95
clamp: 1

lnx10003 ln 1.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005 -> 5E-101 Rounded Inexact Subnormal Underflow

precision: 21
rounding: Up
MaxExponent: 2100
MinExponent: -55
clamp: 0

log10x10001 log10 1.000000000000000000000000000000000000000000000000000000230258509299404568401799145468436420760110149 -> 1.00000000000000000000E-55 Rounded Inexact

-- Restore ExtendedRange because it is a global variable in the C tests.
ExtendedRange: 1