1------------------------------------------------------------------------
2-- dqRemainder.decTest -- decQuad remainder                           --
3-- Copyright (c) IBM Corporation, 1981, 2008.  All rights reserved.   --
4------------------------------------------------------------------------
5-- Please see the document "General Decimal Arithmetic Testcases"     --
6-- at http://www2.hursley.ibm.com/decimal for the description of      --
7-- these testcases.                                                   --
8--                                                                    --
9-- These testcases are experimental ('beta' versions), and they       --
10-- may contain errors.  They are offered on an as-is basis.  In       --
11-- particular, achieving the same results as the tests here is not    --
12-- a guarantee that an implementation complies with any Standard      --
13-- or specification.  The tests are not exhaustive.                   --
14--                                                                    --
15-- Please send comments, suggestions, and corrections to the author:  --
16--   Mike Cowlishaw, IBM Fellow                                       --
17--   IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK         --
18--   mfc@uk.ibm.com                                                   --
19------------------------------------------------------------------------
20version: 2.59
21
22extended:    1
23clamp:       1
24precision:   34
25maxExponent: 6144
26minExponent: -6143
27rounding:    half_even
28
29-- sanity checks (as base, above)
30dqrem001 remainder  1     1    ->  0
31dqrem002 remainder  2     1    ->  0
32dqrem003 remainder  1     2    ->  1
33dqrem004 remainder  2     2    ->  0
34dqrem005 remainder  0     1    ->  0
35dqrem006 remainder  0     2    ->  0
36dqrem007 remainder  1     3    ->  1
37dqrem008 remainder  2     3    ->  2
38dqrem009 remainder  3     3    ->  0
39
40dqrem010 remainder  2.4   1    ->  0.4
41dqrem011 remainder  2.4   -1   ->  0.4
42dqrem012 remainder  -2.4  1    ->  -0.4
43dqrem013 remainder  -2.4  -1   ->  -0.4
44dqrem014 remainder  2.40  1    ->  0.40
45dqrem015 remainder  2.400 1    ->  0.400
46dqrem016 remainder  2.4   2    ->  0.4
47dqrem017 remainder  2.400 2    ->  0.400
48dqrem018 remainder  2.    2    ->  0
49dqrem019 remainder  20    20   ->  0
50
51dqrem020 remainder  187   187    ->  0
52dqrem021 remainder  5     2      ->  1
53dqrem022 remainder  5     2.0    ->  1.0
54dqrem023 remainder  5     2.000  ->  1.000
55dqrem024 remainder  5     0.200  ->  0.000
56dqrem025 remainder  5     0.200  ->  0.000
57
58dqrem030 remainder  1     2      ->  1
59dqrem031 remainder  1     4      ->  1
60dqrem032 remainder  1     8      ->  1
61
62dqrem033 remainder  1     16     ->  1
63dqrem034 remainder  1     32     ->  1
64dqrem035 remainder  1     64     ->  1
65dqrem040 remainder  1    -2      ->  1
66dqrem041 remainder  1    -4      ->  1
67dqrem042 remainder  1    -8      ->  1
68dqrem043 remainder  1    -16     ->  1
69dqrem044 remainder  1    -32     ->  1
70dqrem045 remainder  1    -64     ->  1
71dqrem050 remainder -1     2      ->  -1
72dqrem051 remainder -1     4      ->  -1
73dqrem052 remainder -1     8      ->  -1
74dqrem053 remainder -1     16     ->  -1
75dqrem054 remainder -1     32     ->  -1
76dqrem055 remainder -1     64     ->  -1
77dqrem060 remainder -1    -2      ->  -1
78dqrem061 remainder -1    -4      ->  -1
79dqrem062 remainder -1    -8      ->  -1
80dqrem063 remainder -1    -16     ->  -1
81dqrem064 remainder -1    -32     ->  -1
82dqrem065 remainder -1    -64     ->  -1
83
84dqrem066 remainder  999999999     1  -> 0
85dqrem067 remainder  999999999.4   1  -> 0.4
86dqrem068 remainder  999999999.5   1  -> 0.5
87dqrem069 remainder  999999999.9   1  -> 0.9
88dqrem070 remainder  999999999.999 1  -> 0.999
89dqrem071 remainder  999999.999999 1  -> 0.999999
90dqrem072 remainder  9             1  -> 0
91
92dqrem080 remainder  0.            1  -> 0
93dqrem081 remainder  .0            1  -> 0.0
94dqrem082 remainder  0.00          1  -> 0.00
95dqrem083 remainder  0.00E+9       1  -> 0
96dqrem084 remainder  0.00E+3       1  -> 0
97dqrem085 remainder  0.00E+2       1  -> 0
98dqrem086 remainder  0.00E+1       1  -> 0.0
99dqrem087 remainder  0.00E+0       1  -> 0.00
100dqrem088 remainder  0.00E-0       1  -> 0.00
101dqrem089 remainder  0.00E-1       1  -> 0.000
102dqrem090 remainder  0.00E-2       1  -> 0.0000
103dqrem091 remainder  0.00E-3       1  -> 0.00000
104dqrem092 remainder  0.00E-4       1  -> 0.000000
105dqrem093 remainder  0.00E-5       1  -> 0E-7
106dqrem094 remainder  0.00E-6       1  -> 0E-8
107dqrem095 remainder  0.0000E-50    1  -> 0E-54
108
109-- Various flavours of remainder by 0
110dqrem101 remainder  0       0   -> NaN Division_undefined
111dqrem102 remainder  0      -0   -> NaN Division_undefined
112dqrem103 remainder -0       0   -> NaN Division_undefined
113dqrem104 remainder -0      -0   -> NaN Division_undefined
114dqrem105 remainder  0.0E5   0   -> NaN Division_undefined
115dqrem106 remainder  0.000   0   -> NaN Division_undefined
116-- [Some think this next group should be Division_by_zero exception, but
117-- IEEE 854 is explicit that it is Invalid operation .. for
118-- remainder-near, anyway]
119dqrem107 remainder  0.0001  0   -> NaN Invalid_operation
120dqrem108 remainder  0.01    0   -> NaN Invalid_operation
121dqrem109 remainder  0.1     0   -> NaN Invalid_operation
122dqrem110 remainder  1       0   -> NaN Invalid_operation
123dqrem111 remainder  1       0.0 -> NaN Invalid_operation
124dqrem112 remainder 10       0.0 -> NaN Invalid_operation
125dqrem113 remainder 1E+100   0.0 -> NaN Invalid_operation
126dqrem114 remainder 1E+380   0   -> NaN Invalid_operation
127dqrem115 remainder  0.0001 -0   -> NaN Invalid_operation
128dqrem116 remainder  0.01   -0   -> NaN Invalid_operation
129dqrem119 remainder  0.1    -0   -> NaN Invalid_operation
130dqrem120 remainder  1      -0   -> NaN Invalid_operation
131dqrem121 remainder  1      -0.0 -> NaN Invalid_operation
132dqrem122 remainder 10      -0.0 -> NaN Invalid_operation
133dqrem123 remainder 1E+100  -0.0 -> NaN Invalid_operation
134dqrem124 remainder 1E+384  -0   -> NaN Invalid_operation
135-- and zeros on left
136dqrem130 remainder  0      1   ->  0
137dqrem131 remainder  0     -1   ->  0
138dqrem132 remainder  0.0    1   ->  0.0
139dqrem133 remainder  0.0   -1   ->  0.0
140dqrem134 remainder -0      1   -> -0
141dqrem135 remainder -0     -1   -> -0
142dqrem136 remainder -0.0    1   -> -0.0
143dqrem137 remainder -0.0   -1   -> -0.0
144
145-- 0.5ers
146dqrem143 remainder   0.5  2     ->  0.5
147dqrem144 remainder   0.5  2.1   ->  0.5
148dqrem145 remainder   0.5  2.01  ->  0.50
149dqrem146 remainder   0.5  2.001 ->  0.500
150dqrem147 remainder   0.50 2     ->  0.50
151dqrem148 remainder   0.50 2.01  ->  0.50
152dqrem149 remainder   0.50 2.001 ->  0.500
153
154-- steadies
155dqrem150 remainder  1  1   -> 0
156dqrem151 remainder  1  2   -> 1
157dqrem152 remainder  1  3   -> 1
158dqrem153 remainder  1  4   -> 1
159dqrem154 remainder  1  5   -> 1
160dqrem155 remainder  1  6   -> 1
161dqrem156 remainder  1  7   -> 1
162dqrem157 remainder  1  8   -> 1
163dqrem158 remainder  1  9   -> 1
164dqrem159 remainder  1  10  -> 1
165dqrem160 remainder  1  1   -> 0
166dqrem161 remainder  2  1   -> 0
167dqrem162 remainder  3  1   -> 0
168dqrem163 remainder  4  1   -> 0
169dqrem164 remainder  5  1   -> 0
170dqrem165 remainder  6  1   -> 0
171dqrem166 remainder  7  1   -> 0
172dqrem167 remainder  8  1   -> 0
173dqrem168 remainder  9  1   -> 0
174dqrem169 remainder  10 1   -> 0
175
176-- some differences from remainderNear
177dqrem171 remainder   0.4  1.020 ->  0.400
178dqrem172 remainder   0.50 1.020 ->  0.500
179dqrem173 remainder   0.51 1.020 ->  0.510
180dqrem174 remainder   0.52 1.020 ->  0.520
181dqrem175 remainder   0.6  1.020 ->  0.600
182
183-- More flavours of remainder by 0
184dqrem201 remainder  0      0   -> NaN Division_undefined
185dqrem202 remainder  0.0E5  0   -> NaN Division_undefined
186dqrem203 remainder  0.000  0   -> NaN Division_undefined
187dqrem204 remainder  0.0001 0   -> NaN Invalid_operation
188dqrem205 remainder  0.01   0   -> NaN Invalid_operation
189dqrem206 remainder  0.1    0   -> NaN Invalid_operation
190dqrem207 remainder  1      0   -> NaN Invalid_operation
191dqrem208 remainder  1      0.0 -> NaN Invalid_operation
192dqrem209 remainder 10      0.0 -> NaN Invalid_operation
193dqrem210 remainder 1E+100  0.0 -> NaN Invalid_operation
194dqrem211 remainder 1E+380  0   -> NaN Invalid_operation
195
196-- some differences from remainderNear
197dqrem231 remainder  -0.4  1.020 -> -0.400
198dqrem232 remainder  -0.50 1.020 -> -0.500
199dqrem233 remainder  -0.51 1.020 -> -0.510
200dqrem234 remainder  -0.52 1.020 -> -0.520
201dqrem235 remainder  -0.6  1.020 -> -0.600
202
203-- high Xs
204dqrem240 remainder  1E+2  1.00  ->  0.00
205
206-- dqrem3xx are from DiagBigDecimal
207dqrem301 remainder   1    3     ->  1
208dqrem302 remainder   5    5     ->  0
209dqrem303 remainder   13   10    ->  3
210dqrem304 remainder   13   50    ->  13
211dqrem305 remainder   13   100   ->  13
212dqrem306 remainder   13   1000  ->  13
213dqrem307 remainder   .13    1   ->  0.13
214dqrem308 remainder   0.133  1   ->  0.133
215dqrem309 remainder   0.1033 1   ->  0.1033
216dqrem310 remainder   1.033  1   ->  0.033
217dqrem311 remainder   10.33  1   ->  0.33
218dqrem312 remainder   10.33 10   ->  0.33
219dqrem313 remainder   103.3  1   ->  0.3
220dqrem314 remainder   133   10   ->  3
221dqrem315 remainder   1033  10   ->  3
222dqrem316 remainder   1033  50   ->  33
223dqrem317 remainder   101.0  3   ->  2.0
224dqrem318 remainder   102.0  3   ->  0.0
225dqrem319 remainder   103.0  3   ->  1.0
226dqrem320 remainder   2.40   1   ->  0.40
227dqrem321 remainder   2.400  1   ->  0.400
228dqrem322 remainder   2.4    1   ->  0.4
229dqrem323 remainder   2.4    2   ->  0.4
230dqrem324 remainder   2.400  2   ->  0.400
231dqrem325 remainder   1   0.3    ->  0.1
232dqrem326 remainder   1   0.30   ->  0.10
233dqrem327 remainder   1   0.300  ->  0.100
234dqrem328 remainder   1   0.3000 ->  0.1000
235dqrem329 remainder   1.0    0.3 ->  0.1
236dqrem330 remainder   1.00   0.3 ->  0.10
237dqrem331 remainder   1.000  0.3 ->  0.100
238dqrem332 remainder   1.0000 0.3 ->  0.1000
239dqrem333 remainder   0.5  2     ->  0.5
240dqrem334 remainder   0.5  2.1   ->  0.5
241dqrem335 remainder   0.5  2.01  ->  0.50
242dqrem336 remainder   0.5  2.001 ->  0.500
243dqrem337 remainder   0.50 2     ->  0.50
244dqrem338 remainder   0.50 2.01  ->  0.50
245dqrem339 remainder   0.50 2.001 ->  0.500
246
247dqrem340 remainder   0.5   0.5000001    ->  0.5000000
248dqrem341 remainder   0.5   0.50000001    ->  0.50000000
249dqrem342 remainder   0.5   0.500000001    ->  0.500000000
250dqrem343 remainder   0.5   0.5000000001    ->  0.5000000000
251dqrem344 remainder   0.5   0.50000000001    ->  0.50000000000
252dqrem345 remainder   0.5   0.4999999    ->  1E-7
253dqrem346 remainder   0.5   0.49999999    ->  1E-8
254dqrem347 remainder   0.5   0.499999999    ->  1E-9
255dqrem348 remainder   0.5   0.4999999999    ->  1E-10
256dqrem349 remainder   0.5   0.49999999999    ->  1E-11
257dqrem350 remainder   0.5   0.499999999999    ->  1E-12
258
259dqrem351 remainder   0.03  7  ->  0.03
260dqrem352 remainder   5   2    ->  1
261dqrem353 remainder   4.1   2    ->  0.1
262dqrem354 remainder   4.01   2    ->  0.01
263dqrem355 remainder   4.001   2    ->  0.001
264dqrem356 remainder   4.0001   2    ->  0.0001
265dqrem357 remainder   4.00001   2    ->  0.00001
266dqrem358 remainder   4.000001   2    ->  0.000001
267dqrem359 remainder   4.0000001   2    ->  1E-7
268
269dqrem360 remainder   1.2   0.7345 ->  0.4655
270dqrem361 remainder   0.8   12     ->  0.8
271dqrem362 remainder   0.8   0.2    ->  0.0
272dqrem363 remainder   0.8   0.3    ->  0.2
273dqrem364 remainder   0.800   12   ->  0.800
274dqrem365 remainder   0.800   1.7  ->  0.800
275dqrem366 remainder   2.400   2    ->  0.400
276
277dqrem371 remainder   2.400  2        ->  0.400
278
279dqrem381 remainder 12345  1         ->  0
280dqrem382 remainder 12345  1.0001    ->  0.7657
281dqrem383 remainder 12345  1.001     ->  0.668
282dqrem384 remainder 12345  1.01      ->  0.78
283dqrem385 remainder 12345  1.1       ->  0.8
284dqrem386 remainder 12355  4         ->  3
285dqrem387 remainder 12345  4         ->  1
286dqrem388 remainder 12355  4.0001    ->  2.6912
287dqrem389 remainder 12345  4.0001    ->  0.6914
288dqrem390 remainder 12345  4.9       ->  1.9
289dqrem391 remainder 12345  4.99      ->  4.73
290dqrem392 remainder 12345  4.999     ->  2.469
291dqrem393 remainder 12345  4.9999    ->  0.2469
292dqrem394 remainder 12345  5         ->  0
293dqrem395 remainder 12345  5.0001    ->  4.7532
294dqrem396 remainder 12345  5.001     ->  2.532
295dqrem397 remainder 12345  5.01      ->  0.36
296dqrem398 remainder 12345  5.1       ->  3.0
297
298-- the nasty division-by-1 cases
299dqrem401 remainder   0.5         1   ->  0.5
300dqrem402 remainder   0.55        1   ->  0.55
301dqrem403 remainder   0.555       1   ->  0.555
302dqrem404 remainder   0.5555      1   ->  0.5555
303dqrem405 remainder   0.55555     1   ->  0.55555
304dqrem406 remainder   0.555555    1   ->  0.555555
305dqrem407 remainder   0.5555555   1   ->  0.5555555
306dqrem408 remainder   0.55555555  1   ->  0.55555555
307dqrem409 remainder   0.555555555 1   ->  0.555555555
308
309-- folddowns
310dqrem421 remainder   1E+6144        1  ->   NaN Division_impossible
311dqrem422 remainder   1E+6144  1E+6143  ->   0E+6111 Clamped
312dqrem423 remainder   1E+6144  2E+6143  ->   0E+6111 Clamped
313dqrem424 remainder   1E+6144  3E+6143  ->   1.00000000000000000000000000000000E+6143 Clamped
314dqrem425 remainder   1E+6144  4E+6143  ->   2.00000000000000000000000000000000E+6143 Clamped
315dqrem426 remainder   1E+6144  5E+6143  ->   0E+6111 Clamped
316dqrem427 remainder   1E+6144  6E+6143  ->   4.00000000000000000000000000000000E+6143 Clamped
317dqrem428 remainder   1E+6144  7E+6143  ->   3.00000000000000000000000000000000E+6143 Clamped
318dqrem429 remainder   1E+6144  8E+6143  ->   2.00000000000000000000000000000000E+6143 Clamped
319dqrem430 remainder   1E+6144  9E+6143  ->   1.00000000000000000000000000000000E+6143 Clamped
320-- tinies
321dqrem431 remainder   1E-6175  1E-6176  ->   0E-6176
322dqrem432 remainder   1E-6175  2E-6176  ->   0E-6176
323dqrem433 remainder   1E-6175  3E-6176  ->   1E-6176 Subnormal
324dqrem434 remainder   1E-6175  4E-6176  ->   2E-6176 Subnormal
325dqrem435 remainder   1E-6175  5E-6176  ->   0E-6176
326dqrem436 remainder   1E-6175  6E-6176  ->   4E-6176 Subnormal
327dqrem437 remainder   1E-6175  7E-6176  ->   3E-6176 Subnormal
328dqrem438 remainder   1E-6175  8E-6176  ->   2E-6176 Subnormal
329dqrem439 remainder   1E-6175  9E-6176  ->   1E-6176 Subnormal
330dqrem440 remainder   1E-6175 10E-6176  ->   0E-6176
331dqrem441 remainder   1E-6175 11E-6176  -> 1.0E-6175 Subnormal
332dqrem442 remainder 100E-6175 11E-6176  -> 1.0E-6175 Subnormal
333dqrem443 remainder 100E-6175 20E-6176  ->   0E-6176
334dqrem444 remainder 100E-6175 21E-6176  -> 1.3E-6175 Subnormal
335dqrem445 remainder 100E-6175 30E-6176  -> 1.0E-6175 Subnormal
336
337-- zero signs
338dqrem650 remainder  1  1 ->  0
339dqrem651 remainder -1  1 -> -0
340dqrem652 remainder  1 -1 ->  0
341dqrem653 remainder -1 -1 -> -0
342dqrem654 remainder  0  1 ->  0
343dqrem655 remainder -0  1 -> -0
344dqrem656 remainder  0 -1 ->  0
345dqrem657 remainder -0 -1 -> -0
346dqrem658 remainder  0.00  1  ->  0.00
347dqrem659 remainder -0.00  1  -> -0.00
348
349-- Specials
350dqrem680 remainder  Inf  -Inf   ->  NaN Invalid_operation
351dqrem681 remainder  Inf  -1000  ->  NaN Invalid_operation
352dqrem682 remainder  Inf  -1     ->  NaN Invalid_operation
353dqrem683 remainder  Inf   0     ->  NaN Invalid_operation
354dqrem684 remainder  Inf  -0     ->  NaN Invalid_operation
355dqrem685 remainder  Inf   1     ->  NaN Invalid_operation
356dqrem686 remainder  Inf   1000  ->  NaN Invalid_operation
357dqrem687 remainder  Inf   Inf   ->  NaN Invalid_operation
358dqrem688 remainder -1000  Inf   -> -1000
359dqrem689 remainder -Inf   Inf   ->  NaN Invalid_operation
360dqrem691 remainder -1     Inf   -> -1
361dqrem692 remainder  0     Inf   ->  0
362dqrem693 remainder -0     Inf   -> -0
363dqrem694 remainder  1     Inf   ->  1
364dqrem695 remainder  1000  Inf   ->  1000
365dqrem696 remainder  Inf   Inf   ->  NaN Invalid_operation
366
367dqrem700 remainder -Inf  -Inf   ->  NaN Invalid_operation
368dqrem701 remainder -Inf  -1000  ->  NaN Invalid_operation
369dqrem702 remainder -Inf  -1     ->  NaN Invalid_operation
370dqrem703 remainder -Inf  -0     ->  NaN Invalid_operation
371dqrem704 remainder -Inf   0     ->  NaN Invalid_operation
372dqrem705 remainder -Inf   1     ->  NaN Invalid_operation
373dqrem706 remainder -Inf   1000  ->  NaN Invalid_operation
374dqrem707 remainder -Inf   Inf   ->  NaN Invalid_operation
375dqrem708 remainder -Inf  -Inf   ->  NaN Invalid_operation
376dqrem709 remainder -1000  Inf   -> -1000
377dqrem710 remainder -1    -Inf   -> -1
378dqrem711 remainder -0    -Inf   -> -0
379dqrem712 remainder  0    -Inf   ->  0
380dqrem713 remainder  1    -Inf   ->  1
381dqrem714 remainder  1000 -Inf   ->  1000
382dqrem715 remainder  Inf  -Inf   ->  NaN Invalid_operation
383
384dqrem721 remainder  NaN -Inf    ->  NaN
385dqrem722 remainder  NaN -1000   ->  NaN
386dqrem723 remainder  NaN -1      ->  NaN
387dqrem724 remainder  NaN -0      ->  NaN
388dqrem725 remainder -NaN  0      -> -NaN
389dqrem726 remainder  NaN  1      ->  NaN
390dqrem727 remainder  NaN  1000   ->  NaN
391dqrem728 remainder  NaN  Inf    ->  NaN
392dqrem729 remainder  NaN -NaN    ->  NaN
393dqrem730 remainder -Inf  NaN    ->  NaN
394dqrem731 remainder -1000 NaN    ->  NaN
395dqrem732 remainder -1    NaN    ->  NaN
396dqrem733 remainder -0   -NaN    -> -NaN
397dqrem734 remainder  0    NaN    ->  NaN
398dqrem735 remainder  1   -NaN    -> -NaN
399dqrem736 remainder  1000 NaN    ->  NaN
400dqrem737 remainder  Inf  NaN    ->  NaN
401
402dqrem741 remainder  sNaN -Inf   ->  NaN  Invalid_operation
403dqrem742 remainder  sNaN -1000  ->  NaN  Invalid_operation
404dqrem743 remainder -sNaN -1     -> -NaN  Invalid_operation
405dqrem744 remainder  sNaN -0     ->  NaN  Invalid_operation
406dqrem745 remainder  sNaN  0     ->  NaN  Invalid_operation
407dqrem746 remainder  sNaN  1     ->  NaN  Invalid_operation
408dqrem747 remainder  sNaN  1000  ->  NaN  Invalid_operation
409dqrem749 remainder  sNaN  NaN   ->  NaN  Invalid_operation
410dqrem750 remainder  sNaN sNaN   ->  NaN  Invalid_operation
411dqrem751 remainder  NaN  sNaN   ->  NaN  Invalid_operation
412dqrem752 remainder -Inf  sNaN   ->  NaN  Invalid_operation
413dqrem753 remainder -1000 sNaN   ->  NaN  Invalid_operation
414dqrem754 remainder -1    sNaN   ->  NaN  Invalid_operation
415dqrem755 remainder -0    sNaN   ->  NaN  Invalid_operation
416dqrem756 remainder  0    sNaN   ->  NaN  Invalid_operation
417dqrem757 remainder  1    sNaN   ->  NaN  Invalid_operation
418dqrem758 remainder  1000 sNaN   ->  NaN  Invalid_operation
419dqrem759 remainder  Inf -sNaN   -> -NaN  Invalid_operation
420
421-- propaging NaNs
422dqrem760 remainder  NaN1   NaN7   ->  NaN1
423dqrem761 remainder sNaN2   NaN8   ->  NaN2 Invalid_operation
424dqrem762 remainder  NaN3  sNaN9   ->  NaN9 Invalid_operation
425dqrem763 remainder sNaN4  sNaN10  ->  NaN4 Invalid_operation
426dqrem764 remainder    15   NaN11  ->  NaN11
427dqrem765 remainder  NaN6   NaN12  ->  NaN6
428dqrem766 remainder  Inf    NaN13  ->  NaN13
429dqrem767 remainder  NaN14  -Inf   ->  NaN14
430dqrem768 remainder    0    NaN15  ->  NaN15
431dqrem769 remainder  NaN16   -0    ->  NaN16
432
433-- edge cases of impossible
434dqrem770  remainder  1234568888888887777777777890123456  10    ->  6
435dqrem771  remainder  1234568888888887777777777890123456   1    ->  0
436dqrem772  remainder  1234568888888887777777777890123456   0.1  ->  NaN Division_impossible
437dqrem773  remainder  1234568888888887777777777890123456   0.01 ->  NaN Division_impossible
438
439-- long operand checks
440dqrem801 remainder 12345678000 100 -> 0
441dqrem802 remainder 1 12345678000   -> 1
442dqrem803 remainder 1234567800  10  -> 0
443dqrem804 remainder 1 1234567800    -> 1
444dqrem805 remainder 1234567890  10  -> 0
445dqrem806 remainder 1 1234567890    -> 1
446dqrem807 remainder 1234567891  10  -> 1
447dqrem808 remainder 1 1234567891    -> 1
448dqrem809 remainder 12345678901 100 -> 1
449dqrem810 remainder 1 12345678901   -> 1
450dqrem811 remainder 1234567896  10  -> 6
451dqrem812 remainder 1 1234567896    -> 1
452
453dqrem821 remainder 12345678000 100 -> 0
454dqrem822 remainder 1 12345678000   -> 1
455dqrem823 remainder 1234567800  10  -> 0
456dqrem824 remainder 1 1234567800    -> 1
457dqrem825 remainder 1234567890  10  -> 0
458dqrem826 remainder 1 1234567890    -> 1
459dqrem827 remainder 1234567891  10  -> 1
460dqrem828 remainder 1 1234567891    -> 1
461dqrem829 remainder 12345678901 100 -> 1
462dqrem830 remainder 1 12345678901   -> 1
463dqrem831 remainder 1234567896  10  -> 6
464dqrem832 remainder 1 1234567896    -> 1
465
466-- from divideint
467dqrem840 remainder  100000000.0   1  ->  0.0
468dqrem841 remainder  100000000.4   1  ->  0.4
469dqrem842 remainder  100000000.5   1  ->  0.5
470dqrem843 remainder  100000000.9   1  ->  0.9
471dqrem844 remainder  100000000.999 1  ->  0.999
472dqrem850 remainder  100000003     5  ->  3
473dqrem851 remainder  10000003      5  ->  3
474dqrem852 remainder  1000003       5  ->  3
475dqrem853 remainder  100003        5  ->  3
476dqrem854 remainder  10003         5  ->  3
477dqrem855 remainder  1003          5  ->  3
478dqrem856 remainder  103           5  ->  3
479dqrem857 remainder  13            5  ->  3
480dqrem858 remainder  1             5  ->  1
481
482-- Vladimir's cases         1234567890123456
483dqrem860 remainder 123.0e1 1000000000000000  -> 1230
484dqrem861 remainder 1230    1000000000000000  -> 1230
485dqrem862 remainder 12.3e2  1000000000000000  -> 1230
486dqrem863 remainder 1.23e3  1000000000000000  -> 1230
487dqrem864 remainder 123e1   1000000000000000  -> 1230
488dqrem870 remainder 123e1    1000000000000000 -> 1230
489dqrem871 remainder 123e1     100000000000000 -> 1230
490dqrem872 remainder 123e1      10000000000000 -> 1230
491dqrem873 remainder 123e1       1000000000000 -> 1230
492dqrem874 remainder 123e1        100000000000 -> 1230
493dqrem875 remainder 123e1         10000000000 -> 1230
494dqrem876 remainder 123e1          1000000000 -> 1230
495dqrem877 remainder 123e1           100000000 -> 1230
496dqrem878 remainder 1230            100000000 -> 1230
497dqrem879 remainder 123e1            10000000 -> 1230
498dqrem880 remainder 123e1             1000000 -> 1230
499dqrem881 remainder 123e1              100000 -> 1230
500dqrem882 remainder 123e1               10000 -> 1230
501dqrem883 remainder 123e1                1000 ->  230
502dqrem884 remainder 123e1                 100 ->   30
503dqrem885 remainder 123e1                  10 ->    0
504dqrem886 remainder 123e1                   1 ->    0
505
506dqrem890 remainder 123e1    2000000000000000 -> 1230
507dqrem891 remainder 123e1     200000000000000 -> 1230
508dqrem892 remainder 123e1      20000000000000 -> 1230
509dqrem893 remainder 123e1       2000000000000 -> 1230
510dqrem894 remainder 123e1        200000000000 -> 1230
511dqrem895 remainder 123e1         20000000000 -> 1230
512dqrem896 remainder 123e1          2000000000 -> 1230
513dqrem897 remainder 123e1           200000000 -> 1230
514dqrem899 remainder 123e1            20000000 -> 1230
515dqrem900 remainder 123e1             2000000 -> 1230
516dqrem901 remainder 123e1              200000 -> 1230
517dqrem902 remainder 123e1               20000 -> 1230
518dqrem903 remainder 123e1                2000 -> 1230
519dqrem904 remainder 123e1                 200 ->   30
520dqrem905 remainder 123e1                  20 ->   10
521dqrem906 remainder 123e1                   2 ->    0
522
523dqrem910 remainder 123e1    5000000000000000 -> 1230
524dqrem911 remainder 123e1     500000000000000 -> 1230
525dqrem912 remainder 123e1      50000000000000 -> 1230
526dqrem913 remainder 123e1       5000000000000 -> 1230
527dqrem914 remainder 123e1        500000000000 -> 1230
528dqrem915 remainder 123e1         50000000000 -> 1230
529dqrem916 remainder 123e1          5000000000 -> 1230
530dqrem917 remainder 123e1           500000000 -> 1230
531dqrem919 remainder 123e1            50000000 -> 1230
532dqrem920 remainder 123e1             5000000 -> 1230
533dqrem921 remainder 123e1              500000 -> 1230
534dqrem922 remainder 123e1               50000 -> 1230
535dqrem923 remainder 123e1                5000 -> 1230
536dqrem924 remainder 123e1                 500 ->  230
537dqrem925 remainder 123e1                  50 ->   30
538dqrem926 remainder 123e1                   5 ->    0
539
540dqrem930 remainder 123e1    9000000000000000 -> 1230
541dqrem931 remainder 123e1     900000000000000 -> 1230
542dqrem932 remainder 123e1      90000000000000 -> 1230
543dqrem933 remainder 123e1       9000000000000 -> 1230
544dqrem934 remainder 123e1        900000000000 -> 1230
545dqrem935 remainder 123e1         90000000000 -> 1230
546dqrem936 remainder 123e1          9000000000 -> 1230
547dqrem937 remainder 123e1           900000000 -> 1230
548dqrem939 remainder 123e1            90000000 -> 1230
549dqrem940 remainder 123e1             9000000 -> 1230
550dqrem941 remainder 123e1              900000 -> 1230
551dqrem942 remainder 123e1               90000 -> 1230
552dqrem943 remainder 123e1                9000 -> 1230
553dqrem944 remainder 123e1                 900 ->  330
554dqrem945 remainder 123e1                  90 ->   60
555dqrem946 remainder 123e1                   9 ->    6
556
557dqrem950 remainder 123e1   1000000000000000 -> 1230
558dqrem961 remainder 123e1   2999999999999999 -> 1230
559dqrem962 remainder 123e1   3999999999999999 -> 1230
560dqrem963 remainder 123e1   4999999999999999 -> 1230
561dqrem964 remainder 123e1   5999999999999999 -> 1230
562dqrem965 remainder 123e1   6999999999999999 -> 1230
563dqrem966 remainder 123e1   7999999999999999 -> 1230
564dqrem967 remainder 123e1   8999999999999999 -> 1230
565dqrem968 remainder 123e1   9999999999999999 -> 1230
566dqrem969 remainder 123e1   9876543210987654 -> 1230
567
568dqrem980 remainder 123e1 1000E299 -> 1.23E+3  -- 123E+1 internally
569
570-- overflow and underflow tests [from divide]
571dqrem1051 remainder  1e+277  1e-311 ->  NaN Division_impossible
572dqrem1052 remainder  1e+277 -1e-311 ->  NaN Division_impossible
573dqrem1053 remainder -1e+277  1e-311 ->  NaN Division_impossible
574dqrem1054 remainder -1e+277 -1e-311 ->  NaN Division_impossible
575dqrem1055 remainder  1e-277  1e+311 ->  1E-277
576dqrem1056 remainder  1e-277 -1e+311 ->  1E-277
577dqrem1057 remainder -1e-277  1e+311 -> -1E-277
578dqrem1058 remainder -1e-277 -1e+311 -> -1E-277
579
580-- Gyuris example
581dqrem1070 remainder 8.336804418094040989630006819881709E-6143 8.336804418094040989630006819889000E-6143 -> 8.336804418094040989630006819881709E-6143
582
583-- destructive subtract
584dqrem1120  remainder  1234567890123456789012345678901234  1.000000000000000000000000000000001  ->  0.765432109876543210987654321098768
585dqrem1121  remainder  1234567890123456789012345678901234   1.00000000000000000000000000000001  ->   0.65432109876543210987654321098779
586dqrem1122  remainder  1234567890123456789012345678901234    1.0000000000000000000000000000001  ->    0.5432109876543210987654321098890
587dqrem1123  remainder  1234567890123456789012345678901255  4.000000000000000000000000000000001  ->  2.691358027469135802746913580274687
588dqrem1124  remainder  1234567890123456789012345678901234  4.000000000000000000000000000000001  ->  1.691358027469135802746913580274692
589dqrem1125  remainder  1234567890123456789012345678901234    4.9999999999999999999999999999999  ->    3.6913578024691357802469135780251
590dqrem1126  remainder  1234567890123456789012345678901234   4.99999999999999999999999999999999  ->   1.46913578024691357802469135780247
591dqrem1127  remainder  1234567890123456789012345678901234  4.999999999999999999999999999999999  ->  4.246913578024691357802469135780246
592dqrem1128  remainder  1234567890123456789012345678901234    5.0000000000000000000000000000001  ->    4.3086421975308642197530864219759
593
594-- Null tests
595dqrem1000 remainder 10  # -> NaN Invalid_operation
596dqrem1001 remainder  # 10 -> NaN Invalid_operation
597
598