1------------------------------------------------------------------------
2-- remainder.decTest -- decimal 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
23precision:   9
24rounding:    half_up
25maxExponent: 384
26minexponent: -383
27
28-- sanity checks (as base, above)
29remx001 remainder  1     1    ->  0
30remx002 remainder  2     1    ->  0
31remx003 remainder  1     2    ->  1
32remx004 remainder  2     2    ->  0
33remx005 remainder  0     1    ->  0
34remx006 remainder  0     2    ->  0
35remx007 remainder  1     3    ->  1
36remx008 remainder  2     3    ->  2
37remx009 remainder  3     3    ->  0
38
39remx010 remainder  2.4   1    ->  0.4
40remx011 remainder  2.4   -1   ->  0.4
41remx012 remainder  -2.4  1    ->  -0.4
42remx013 remainder  -2.4  -1   ->  -0.4
43remx014 remainder  2.40  1    ->  0.40
44remx015 remainder  2.400 1    ->  0.400
45remx016 remainder  2.4   2    ->  0.4
46remx017 remainder  2.400 2    ->  0.400
47remx018 remainder  2.    2    ->  0
48remx019 remainder  20    20   ->  0
49
50remx020 remainder  187   187    ->  0
51remx021 remainder  5     2      ->  1
52remx022 remainder  5     2.0    ->  1.0
53remx023 remainder  5     2.000  ->  1.000
54remx024 remainder  5     0.200  ->  0.000
55remx025 remainder  5     0.200  ->  0.000
56
57remx030 remainder  1     2      ->  1
58remx031 remainder  1     4      ->  1
59remx032 remainder  1     8      ->  1
60
61remx033 remainder  1     16     ->  1
62remx034 remainder  1     32     ->  1
63remx035 remainder  1     64     ->  1
64remx040 remainder  1    -2      ->  1
65remx041 remainder  1    -4      ->  1
66remx042 remainder  1    -8      ->  1
67remx043 remainder  1    -16     ->  1
68remx044 remainder  1    -32     ->  1
69remx045 remainder  1    -64     ->  1
70remx050 remainder -1     2      ->  -1
71remx051 remainder -1     4      ->  -1
72remx052 remainder -1     8      ->  -1
73remx053 remainder -1     16     ->  -1
74remx054 remainder -1     32     ->  -1
75remx055 remainder -1     64     ->  -1
76remx060 remainder -1    -2      ->  -1
77remx061 remainder -1    -4      ->  -1
78remx062 remainder -1    -8      ->  -1
79remx063 remainder -1    -16     ->  -1
80remx064 remainder -1    -32     ->  -1
81remx065 remainder -1    -64     ->  -1
82
83remx066 remainder  999999999     1  -> 0
84remx067 remainder  999999999.4   1  -> 0.4
85remx068 remainder  999999999.5   1  -> 0.5
86remx069 remainder  999999999.9   1  -> 0.9
87remx070 remainder  999999999.999 1  -> 0.999
88precision: 6
89remx071 remainder  999999999     1  -> NaN Division_impossible
90remx072 remainder  99999999      1  -> NaN Division_impossible
91remx073 remainder  9999999       1  -> NaN Division_impossible
92remx074 remainder  999999        1  -> 0
93remx075 remainder  99999         1  -> 0
94remx076 remainder  9999          1  -> 0
95remx077 remainder  999           1  -> 0
96remx078 remainder  99            1  -> 0
97remx079 remainder  9             1  -> 0
98
99precision: 9
100remx080 remainder  0.            1  -> 0
101remx081 remainder  .0            1  -> 0.0
102remx082 remainder  0.00          1  -> 0.00
103remx083 remainder  0.00E+9       1  -> 0
104remx084 remainder  0.00E+3       1  -> 0
105remx085 remainder  0.00E+2       1  -> 0
106remx086 remainder  0.00E+1       1  -> 0.0
107remx087 remainder  0.00E+0       1  -> 0.00
108remx088 remainder  0.00E-0       1  -> 0.00
109remx089 remainder  0.00E-1       1  -> 0.000
110remx090 remainder  0.00E-2       1  -> 0.0000
111remx091 remainder  0.00E-3       1  -> 0.00000
112remx092 remainder  0.00E-4       1  -> 0.000000
113remx093 remainder  0.00E-5       1  -> 0E-7
114remx094 remainder  0.00E-6       1  -> 0E-8
115remx095 remainder  0.0000E-50    1  -> 0E-54
116
117-- Various flavours of remainder by 0
118precision: 9
119maxexponent: 999999999
120minexponent: -999999999
121remx101 remainder  0       0   -> NaN Division_undefined
122remx102 remainder  0      -0   -> NaN Division_undefined
123remx103 remainder -0       0   -> NaN Division_undefined
124remx104 remainder -0      -0   -> NaN Division_undefined
125remx105 remainder  0.0E5   0   -> NaN Division_undefined
126remx106 remainder  0.000   0   -> NaN Division_undefined
127-- [Some think this next group should be Division_by_zero exception, but
128-- IEEE 854 is explicit that it is Invalid operation .. for
129-- remainder-near, anyway]
130remx107 remainder  0.0001  0   -> NaN Invalid_operation
131remx108 remainder  0.01    0   -> NaN Invalid_operation
132remx109 remainder  0.1     0   -> NaN Invalid_operation
133remx110 remainder  1       0   -> NaN Invalid_operation
134remx111 remainder  1       0.0 -> NaN Invalid_operation
135remx112 remainder 10       0.0 -> NaN Invalid_operation
136remx113 remainder 1E+100   0.0 -> NaN Invalid_operation
137remx114 remainder 1E+1000  0   -> NaN Invalid_operation
138remx115 remainder  0.0001 -0   -> NaN Invalid_operation
139remx116 remainder  0.01   -0   -> NaN Invalid_operation
140remx119 remainder  0.1    -0   -> NaN Invalid_operation
141remx120 remainder  1      -0   -> NaN Invalid_operation
142remx121 remainder  1      -0.0 -> NaN Invalid_operation
143remx122 remainder 10      -0.0 -> NaN Invalid_operation
144remx123 remainder 1E+100  -0.0 -> NaN Invalid_operation
145remx124 remainder 1E+1000 -0   -> NaN Invalid_operation
146-- and zeros on left
147remx130 remainder  0      1   ->  0
148remx131 remainder  0     -1   ->  0
149remx132 remainder  0.0    1   ->  0.0
150remx133 remainder  0.0   -1   ->  0.0
151remx134 remainder -0      1   -> -0
152remx135 remainder -0     -1   -> -0
153remx136 remainder -0.0    1   -> -0.0
154remx137 remainder -0.0   -1   -> -0.0
155
156-- 0.5ers
157remx143 remainder   0.5  2     ->  0.5
158remx144 remainder   0.5  2.1   ->  0.5
159remx145 remainder   0.5  2.01  ->  0.50
160remx146 remainder   0.5  2.001 ->  0.500
161remx147 remainder   0.50 2     ->  0.50
162remx148 remainder   0.50 2.01  ->  0.50
163remx149 remainder   0.50 2.001 ->  0.500
164
165-- steadies
166remx150 remainder  1  1   -> 0
167remx151 remainder  1  2   -> 1
168remx152 remainder  1  3   -> 1
169remx153 remainder  1  4   -> 1
170remx154 remainder  1  5   -> 1
171remx155 remainder  1  6   -> 1
172remx156 remainder  1  7   -> 1
173remx157 remainder  1  8   -> 1
174remx158 remainder  1  9   -> 1
175remx159 remainder  1  10  -> 1
176remx160 remainder  1  1   -> 0
177remx161 remainder  2  1   -> 0
178remx162 remainder  3  1   -> 0
179remx163 remainder  4  1   -> 0
180remx164 remainder  5  1   -> 0
181remx165 remainder  6  1   -> 0
182remx166 remainder  7  1   -> 0
183remx167 remainder  8  1   -> 0
184remx168 remainder  9  1   -> 0
185remx169 remainder  10 1   -> 0
186
187-- some differences from remainderNear
188remx171 remainder   0.4  1.020 ->  0.400
189remx172 remainder   0.50 1.020 ->  0.500
190remx173 remainder   0.51 1.020 ->  0.510
191remx174 remainder   0.52 1.020 ->  0.520
192remx175 remainder   0.6  1.020 ->  0.600
193
194
195-- More flavours of remainder by 0
196maxexponent: 999999999
197minexponent: -999999999
198remx201 remainder  0      0   -> NaN Division_undefined
199remx202 remainder  0.0E5  0   -> NaN Division_undefined
200remx203 remainder  0.000  0   -> NaN Division_undefined
201remx204 remainder  0.0001 0   -> NaN Invalid_operation
202remx205 remainder  0.01   0   -> NaN Invalid_operation
203remx206 remainder  0.1    0   -> NaN Invalid_operation
204remx207 remainder  1      0   -> NaN Invalid_operation
205remx208 remainder  1      0.0 -> NaN Invalid_operation
206remx209 remainder 10      0.0 -> NaN Invalid_operation
207remx210 remainder 1E+100  0.0 -> NaN Invalid_operation
208remx211 remainder 1E+1000 0   -> NaN Invalid_operation
209
210-- some differences from remainderNear
211remx231 remainder  -0.4  1.020 -> -0.400
212remx232 remainder  -0.50 1.020 -> -0.500
213remx233 remainder  -0.51 1.020 -> -0.510
214remx234 remainder  -0.52 1.020 -> -0.520
215remx235 remainder  -0.6  1.020 -> -0.600
216
217-- high Xs
218remx240 remainder  1E+2  1.00  ->  0.00
219
220
221-- test some cases that are close to exponent overflow
222maxexponent: 999999999
223minexponent: -999999999
224remx270 remainder 1 1e999999999    -> 1
225remx271 remainder 1 0.9e999999999  -> 1
226remx272 remainder 1 0.99e999999999 -> 1
227remx273 remainder 1 0.999999999e999999999 -> 1
228remx274 remainder 9e999999999          1 -> NaN Division_impossible
229remx275 remainder 9.9e999999999        1 -> NaN Division_impossible
230remx276 remainder 9.99e999999999       1 -> NaN Division_impossible
231remx277 remainder 9.99999999e999999999 1 -> NaN Division_impossible
232
233remx280 remainder 0.1 9e-999999999       -> NaN Division_impossible
234remx281 remainder 0.1 99e-999999999      -> NaN Division_impossible
235remx282 remainder 0.1 999e-999999999     -> NaN Division_impossible
236
237remx283 remainder 0.1 9e-999999998       -> NaN Division_impossible
238remx284 remainder 0.1 99e-999999998      -> NaN Division_impossible
239remx285 remainder 0.1 999e-999999998     -> NaN Division_impossible
240remx286 remainder 0.1 999e-999999997     -> NaN Division_impossible
241remx287 remainder 0.1 9999e-999999997    -> NaN Division_impossible
242remx288 remainder 0.1 99999e-999999997   -> NaN Division_impossible
243
244-- remx3xx are from DiagBigDecimal
245remx301 remainder   1    3     ->  1
246remx302 remainder   5    5     ->  0
247remx303 remainder   13   10    ->  3
248remx304 remainder   13   50    ->  13
249remx305 remainder   13   100   ->  13
250remx306 remainder   13   1000  ->  13
251remx307 remainder   .13    1   ->  0.13
252remx308 remainder   0.133  1   ->  0.133
253remx309 remainder   0.1033 1   ->  0.1033
254remx310 remainder   1.033  1   ->  0.033
255remx311 remainder   10.33  1   ->  0.33
256remx312 remainder   10.33 10   ->  0.33
257remx313 remainder   103.3  1   ->  0.3
258remx314 remainder   133   10   ->  3
259remx315 remainder   1033  10   ->  3
260remx316 remainder   1033  50   ->  33
261remx317 remainder   101.0  3   ->  2.0
262remx318 remainder   102.0  3   ->  0.0
263remx319 remainder   103.0  3   ->  1.0
264remx320 remainder   2.40   1   ->  0.40
265remx321 remainder   2.400  1   ->  0.400
266remx322 remainder   2.4    1   ->  0.4
267remx323 remainder   2.4    2   ->  0.4
268remx324 remainder   2.400  2   ->  0.400
269remx325 remainder   1   0.3    ->  0.1
270remx326 remainder   1   0.30   ->  0.10
271remx327 remainder   1   0.300  ->  0.100
272remx328 remainder   1   0.3000 ->  0.1000
273remx329 remainder   1.0    0.3 ->  0.1
274remx330 remainder   1.00   0.3 ->  0.10
275remx331 remainder   1.000  0.3 ->  0.100
276remx332 remainder   1.0000 0.3 ->  0.1000
277remx333 remainder   0.5  2     ->  0.5
278remx334 remainder   0.5  2.1   ->  0.5
279remx335 remainder   0.5  2.01  ->  0.50
280remx336 remainder   0.5  2.001 ->  0.500
281remx337 remainder   0.50 2     ->  0.50
282remx338 remainder   0.50 2.01  ->  0.50
283remx339 remainder   0.50 2.001 ->  0.500
284
285remx340 remainder   0.5   0.5000001    ->  0.5000000
286remx341 remainder   0.5   0.50000001    ->  0.50000000
287remx342 remainder   0.5   0.500000001    ->  0.500000000
288remx343 remainder   0.5   0.5000000001    ->  0.500000000  Rounded
289remx344 remainder   0.5   0.50000000001    ->  0.500000000  Rounded
290remx345 remainder   0.5   0.4999999    ->  1E-7
291remx346 remainder   0.5   0.49999999    ->  1E-8
292remx347 remainder   0.5   0.499999999    ->  1E-9
293remx348 remainder   0.5   0.4999999999    ->  1E-10
294remx349 remainder   0.5   0.49999999999    ->  1E-11
295remx350 remainder   0.5   0.499999999999    ->  1E-12
296
297remx351 remainder   0.03  7  ->  0.03
298remx352 remainder   5   2    ->  1
299remx353 remainder   4.1   2    ->  0.1
300remx354 remainder   4.01   2    ->  0.01
301remx355 remainder   4.001   2    ->  0.001
302remx356 remainder   4.0001   2    ->  0.0001
303remx357 remainder   4.00001   2    ->  0.00001
304remx358 remainder   4.000001   2    ->  0.000001
305remx359 remainder   4.0000001   2    ->  1E-7
306
307remx360 remainder   1.2   0.7345 ->  0.4655
308remx361 remainder   0.8   12     ->  0.8
309remx362 remainder   0.8   0.2    ->  0.0
310remx363 remainder   0.8   0.3    ->  0.2
311remx364 remainder   0.800   12   ->  0.800
312remx365 remainder   0.800   1.7  ->  0.800
313remx366 remainder   2.400   2    ->  0.400
314
315precision: 6
316remx371 remainder   2.400  2        ->  0.400
317precision: 3
318-- long operand, rounded, case
319remx372 remainder   12345678900000 12e+12 -> 3.46E+11 Inexact Rounded
320--                  12000000000000
321
322precision: 5
323remx381 remainder 12345  1         ->  0
324remx382 remainder 12345  1.0001    ->  0.7657
325remx383 remainder 12345  1.001     ->  0.668
326remx384 remainder 12345  1.01      ->  0.78
327remx385 remainder 12345  1.1       ->  0.8
328remx386 remainder 12355  4         ->  3
329remx387 remainder 12345  4         ->  1
330remx388 remainder 12355  4.0001    ->  2.6912
331remx389 remainder 12345  4.0001    ->  0.6914
332remx390 remainder 12345  4.9       ->  1.9
333remx391 remainder 12345  4.99      ->  4.73
334remx392 remainder 12345  4.999     ->  2.469
335remx393 remainder 12345  4.9999    ->  0.2469
336remx394 remainder 12345  5         ->  0
337remx395 remainder 12345  5.0001    ->  4.7532
338remx396 remainder 12345  5.001     ->  2.532
339remx397 remainder 12345  5.01      ->  0.36
340remx398 remainder 12345  5.1       ->  3.0
341
342precision: 9
343-- the nasty division-by-1 cases
344remx401 remainder   0.5         1   ->  0.5
345remx402 remainder   0.55        1   ->  0.55
346remx403 remainder   0.555       1   ->  0.555
347remx404 remainder   0.5555      1   ->  0.5555
348remx405 remainder   0.55555     1   ->  0.55555
349remx406 remainder   0.555555    1   ->  0.555555
350remx407 remainder   0.5555555   1   ->  0.5555555
351remx408 remainder   0.55555555  1   ->  0.55555555
352remx409 remainder   0.555555555 1   ->  0.555555555
353
354-- zero signs
355remx650 remainder  1  1 ->  0
356remx651 remainder -1  1 -> -0
357remx652 remainder  1 -1 ->  0
358remx653 remainder -1 -1 -> -0
359remx654 remainder  0  1 ->  0
360remx655 remainder -0  1 -> -0
361remx656 remainder  0 -1 ->  0
362remx657 remainder -0 -1 -> -0
363remx658 remainder  0.00  1  ->  0.00
364remx659 remainder -0.00  1  -> -0.00
365
366-- Specials
367remx680 remainder  Inf  -Inf   ->  NaN Invalid_operation
368remx681 remainder  Inf  -1000  ->  NaN Invalid_operation
369remx682 remainder  Inf  -1     ->  NaN Invalid_operation
370remx683 remainder  Inf   0     ->  NaN Invalid_operation
371remx684 remainder  Inf  -0     ->  NaN Invalid_operation
372remx685 remainder  Inf   1     ->  NaN Invalid_operation
373remx686 remainder  Inf   1000  ->  NaN Invalid_operation
374remx687 remainder  Inf   Inf   ->  NaN Invalid_operation
375remx688 remainder -1000  Inf   -> -1000
376remx689 remainder -Inf   Inf   ->  NaN Invalid_operation
377remx691 remainder -1     Inf   -> -1
378remx692 remainder  0     Inf   ->  0
379remx693 remainder -0     Inf   -> -0
380remx694 remainder  1     Inf   ->  1
381remx695 remainder  1000  Inf   ->  1000
382remx696 remainder  Inf   Inf   ->  NaN Invalid_operation
383
384remx700 remainder -Inf  -Inf   ->  NaN Invalid_operation
385remx701 remainder -Inf  -1000  ->  NaN Invalid_operation
386remx702 remainder -Inf  -1     ->  NaN Invalid_operation
387remx703 remainder -Inf  -0     ->  NaN Invalid_operation
388remx704 remainder -Inf   0     ->  NaN Invalid_operation
389remx705 remainder -Inf   1     ->  NaN Invalid_operation
390remx706 remainder -Inf   1000  ->  NaN Invalid_operation
391remx707 remainder -Inf   Inf   ->  NaN Invalid_operation
392remx708 remainder -Inf  -Inf   ->  NaN Invalid_operation
393remx709 remainder -1000  Inf   -> -1000
394remx710 remainder -1    -Inf   -> -1
395remx711 remainder -0    -Inf   -> -0
396remx712 remainder  0    -Inf   ->  0
397remx713 remainder  1    -Inf   ->  1
398remx714 remainder  1000 -Inf   ->  1000
399remx715 remainder  Inf  -Inf   ->  NaN Invalid_operation
400
401remx721 remainder  NaN -Inf    ->  NaN
402remx722 remainder  NaN -1000   ->  NaN
403remx723 remainder  NaN -1      ->  NaN
404remx724 remainder  NaN -0      ->  NaN
405remx725 remainder -NaN  0      -> -NaN
406remx726 remainder  NaN  1      ->  NaN
407remx727 remainder  NaN  1000   ->  NaN
408remx728 remainder  NaN  Inf    ->  NaN
409remx729 remainder  NaN -NaN    ->  NaN
410remx730 remainder -Inf  NaN    ->  NaN
411remx731 remainder -1000 NaN    ->  NaN
412remx732 remainder -1    NaN    ->  NaN
413remx733 remainder -0   -NaN    -> -NaN
414remx734 remainder  0    NaN    ->  NaN
415remx735 remainder  1   -NaN    -> -NaN
416remx736 remainder  1000 NaN    ->  NaN
417remx737 remainder  Inf  NaN    ->  NaN
418
419remx741 remainder  sNaN -Inf   ->  NaN  Invalid_operation
420remx742 remainder  sNaN -1000  ->  NaN  Invalid_operation
421remx743 remainder -sNaN -1     -> -NaN  Invalid_operation
422remx744 remainder  sNaN -0     ->  NaN  Invalid_operation
423remx745 remainder  sNaN  0     ->  NaN  Invalid_operation
424remx746 remainder  sNaN  1     ->  NaN  Invalid_operation
425remx747 remainder  sNaN  1000  ->  NaN  Invalid_operation
426remx749 remainder  sNaN  NaN   ->  NaN  Invalid_operation
427remx750 remainder  sNaN sNaN   ->  NaN  Invalid_operation
428remx751 remainder  NaN  sNaN   ->  NaN  Invalid_operation
429remx752 remainder -Inf  sNaN   ->  NaN  Invalid_operation
430remx753 remainder -1000 sNaN   ->  NaN  Invalid_operation
431remx754 remainder -1    sNaN   ->  NaN  Invalid_operation
432remx755 remainder -0    sNaN   ->  NaN  Invalid_operation
433remx756 remainder  0    sNaN   ->  NaN  Invalid_operation
434remx757 remainder  1    sNaN   ->  NaN  Invalid_operation
435remx758 remainder  1000 sNaN   ->  NaN  Invalid_operation
436remx759 remainder  Inf -sNaN   -> -NaN  Invalid_operation
437
438-- propaging NaNs
439remx760 remainder  NaN1   NaN7   ->  NaN1
440remx761 remainder sNaN2   NaN8   ->  NaN2 Invalid_operation
441remx762 remainder  NaN3  sNaN9   ->  NaN9 Invalid_operation
442remx763 remainder sNaN4  sNaN10  ->  NaN4 Invalid_operation
443remx764 remainder    15   NaN11  ->  NaN11
444remx765 remainder  NaN6   NaN12  ->  NaN6
445remx766 remainder  Inf    NaN13  ->  NaN13
446remx767 remainder  NaN14  -Inf   ->  NaN14
447remx768 remainder    0    NaN15  ->  NaN15
448remx769 remainder  NaN16   -0    ->  NaN16
449
450-- test some cases that are close to exponent overflow
451maxexponent: 999999999
452minexponent: -999999999
453remx770 remainder 1 1e999999999    -> 1
454remx771 remainder 1 0.9e999999999  -> 1
455remx772 remainder 1 0.99e999999999 -> 1
456remx773 remainder 1 0.999999999e999999999 -> 1
457remx774 remainder 9e999999999          1 -> NaN Division_impossible
458remx775 remainder 9.9e999999999        1 -> NaN Division_impossible
459remx776 remainder 9.99e999999999       1 -> NaN Division_impossible
460remx777 remainder 9.99999999e999999999 1 -> NaN Division_impossible
461
462-- long operand checks
463maxexponent: 999
464minexponent: -999
465precision: 9
466remx801 remainder 12345678000 100 -> 0
467remx802 remainder 1 12345678000   -> 1
468remx803 remainder 1234567800  10  -> 0
469remx804 remainder 1 1234567800    -> 1
470remx805 remainder 1234567890  10  -> 0
471remx806 remainder 1 1234567890    -> 1
472remx807 remainder 1234567891  10  -> 1
473remx808 remainder 1 1234567891    -> 1
474remx809 remainder 12345678901 100 -> 1
475remx810 remainder 1 12345678901   -> 1
476remx811 remainder 1234567896  10  -> 6
477remx812 remainder 1 1234567896    -> 1
478
479precision: 15
480remx821 remainder 12345678000 100 -> 0
481remx822 remainder 1 12345678000   -> 1
482remx823 remainder 1234567800  10  -> 0
483remx824 remainder 1 1234567800    -> 1
484remx825 remainder 1234567890  10  -> 0
485remx826 remainder 1 1234567890    -> 1
486remx827 remainder 1234567891  10  -> 1
487remx828 remainder 1 1234567891    -> 1
488remx829 remainder 12345678901 100 -> 1
489remx830 remainder 1 12345678901   -> 1
490remx831 remainder 1234567896  10  -> 6
491remx832 remainder 1 1234567896    -> 1
492
493-- worries from divideint
494precision: 8
495remx840 remainder  100000000.0   1  ->  NaN Division_impossible
496remx841 remainder  100000000.4   1  ->  NaN Division_impossible
497remx842 remainder  100000000.5   1  ->  NaN Division_impossible
498remx843 remainder  100000000.9   1  ->  NaN Division_impossible
499remx844 remainder  100000000.999 1  ->  NaN Division_impossible
500precision: 6
501remx850 remainder  100000003     5  ->  NaN Division_impossible
502remx851 remainder  10000003      5  ->  NaN Division_impossible
503remx852 remainder  1000003       5  ->  3
504remx853 remainder  100003        5  ->  3
505remx854 remainder  10003         5  ->  3
506remx855 remainder  1003          5  ->  3
507remx856 remainder  103           5  ->  3
508remx857 remainder  13            5  ->  3
509remx858 remainder  1             5  ->  1
510
511-- Vladimir's cases
512remx860 remainder 123.0e1 10000000000000000 -> 1230
513remx861 remainder 1230    10000000000000000 -> 1230
514remx862 remainder 12.3e2  10000000000000000 -> 1230
515remx863 remainder 1.23e3  10000000000000000 -> 1230
516remx864 remainder 123e1   10000000000000000 -> 1230
517remx870 remainder 123e1    1000000000000000 -> 1230
518remx871 remainder 123e1     100000000000000 -> 1230
519remx872 remainder 123e1      10000000000000 -> 1230
520remx873 remainder 123e1       1000000000000 -> 1230
521remx874 remainder 123e1        100000000000 -> 1230
522remx875 remainder 123e1         10000000000 -> 1230
523remx876 remainder 123e1          1000000000 -> 1230
524remx877 remainder 123e1           100000000 -> 1230
525remx878 remainder 1230            100000000 -> 1230
526remx879 remainder 123e1            10000000 -> 1230
527remx880 remainder 123e1             1000000 -> 1230
528remx881 remainder 123e1              100000 -> 1230
529remx882 remainder 123e1               10000 -> 1230
530remx883 remainder 123e1                1000 ->  230
531remx884 remainder 123e1                 100 ->   30
532remx885 remainder 123e1                  10 ->    0
533remx886 remainder 123e1                   1 ->    0
534
535remx889 remainder 123e1   20000000000000000 -> 1230
536remx890 remainder 123e1    2000000000000000 -> 1230
537remx891 remainder 123e1     200000000000000 -> 1230
538remx892 remainder 123e1      20000000000000 -> 1230
539remx893 remainder 123e1       2000000000000 -> 1230
540remx894 remainder 123e1        200000000000 -> 1230
541remx895 remainder 123e1         20000000000 -> 1230
542remx896 remainder 123e1          2000000000 -> 1230
543remx897 remainder 123e1           200000000 -> 1230
544remx899 remainder 123e1            20000000 -> 1230
545remx900 remainder 123e1             2000000 -> 1230
546remx901 remainder 123e1              200000 -> 1230
547remx902 remainder 123e1               20000 -> 1230
548remx903 remainder 123e1                2000 -> 1230
549remx904 remainder 123e1                 200 ->   30
550remx905 remainder 123e1                  20 ->   10
551remx906 remainder 123e1                   2 ->    0
552
553remx909 remainder 123e1   50000000000000000 -> 1230
554remx910 remainder 123e1    5000000000000000 -> 1230
555remx911 remainder 123e1     500000000000000 -> 1230
556remx912 remainder 123e1      50000000000000 -> 1230
557remx913 remainder 123e1       5000000000000 -> 1230
558remx914 remainder 123e1        500000000000 -> 1230
559remx915 remainder 123e1         50000000000 -> 1230
560remx916 remainder 123e1          5000000000 -> 1230
561remx917 remainder 123e1           500000000 -> 1230
562remx919 remainder 123e1            50000000 -> 1230
563remx920 remainder 123e1             5000000 -> 1230
564remx921 remainder 123e1              500000 -> 1230
565remx922 remainder 123e1               50000 -> 1230
566remx923 remainder 123e1                5000 -> 1230
567remx924 remainder 123e1                 500 ->  230
568remx925 remainder 123e1                  50 ->   30
569remx926 remainder 123e1                   5 ->    0
570
571remx929 remainder 123e1   90000000000000000 -> 1230
572remx930 remainder 123e1    9000000000000000 -> 1230
573remx931 remainder 123e1     900000000000000 -> 1230
574remx932 remainder 123e1      90000000000000 -> 1230
575remx933 remainder 123e1       9000000000000 -> 1230
576remx934 remainder 123e1        900000000000 -> 1230
577remx935 remainder 123e1         90000000000 -> 1230
578remx936 remainder 123e1          9000000000 -> 1230
579remx937 remainder 123e1           900000000 -> 1230
580remx939 remainder 123e1            90000000 -> 1230
581remx940 remainder 123e1             9000000 -> 1230
582remx941 remainder 123e1              900000 -> 1230
583remx942 remainder 123e1               90000 -> 1230
584remx943 remainder 123e1                9000 -> 1230
585remx944 remainder 123e1                 900 ->  330
586remx945 remainder 123e1                  90 ->   60
587remx946 remainder 123e1                   9 ->    6
588
589remx950 remainder 123e1   10000000000000000 -> 1230
590remx951 remainder 123e1   100000000000000000 -> 1230
591remx952 remainder 123e1   1000000000000000000 -> 1230
592remx953 remainder 123e1   10000000000000000000 -> 1230
593remx954 remainder 123e1   100000000000000000000 -> 1230
594remx955 remainder 123e1   1000000000000000000000 -> 1230
595remx956 remainder 123e1   10000000000000000000000 -> 1230
596remx957 remainder 123e1   100000000000000000000000 -> 1230
597remx958 remainder 123e1   1000000000000000000000000 -> 1230
598remx959 remainder 123e1   10000000000000000000000000 -> 1230
599
600remx960 remainder 123e1   19999999999999999 -> 1230
601remx961 remainder 123e1   199999999999999990 -> 1230
602remx962 remainder 123e1   1999999999999999999 -> 1230
603remx963 remainder 123e1   19999999999999999990 -> 1230
604remx964 remainder 123e1   199999999999999999999 -> 1230
605remx965 remainder 123e1   1999999999999999999990 -> 1230
606remx966 remainder 123e1   19999999999999999999999 -> 1230
607remx967 remainder 123e1   199999999999999999999990 -> 1230
608remx968 remainder 123e1   1999999999999999999999999 -> 1230
609remx969 remainder 123e1   19999999999999999999999990 -> 1230
610
611remx970 remainder 1e1   10000000000000000 -> 10
612remx971 remainder 1e1   100000000000000000 -> 10
613remx972 remainder 1e1   1000000000000000000 -> 10
614remx973 remainder 1e1   10000000000000000000 -> 10
615remx974 remainder 1e1   100000000000000000000 -> 10
616remx975 remainder 1e1   1000000000000000000000 -> 10
617remx976 remainder 1e1   10000000000000000000000 -> 10
618remx977 remainder 1e1   100000000000000000000000 -> 10
619remx978 remainder 1e1   1000000000000000000000000 -> 10
620remx979 remainder 1e1   10000000000000000000000000 -> 10
621
622remx980 remainder 123e1 1000E999999 -> 1.23E+3  -- 123E+1 internally
623
624-- overflow and underflow tests [from divide]
625precision: 9
626maxexponent: 999999999
627minexponent: -999999999
628remx990 remainder +1.23456789012345E-0 9E+999999999 -> 1.23456789 Inexact Rounded
629remx991 remainder 9E+999999999 +0.23456789012345E-0 -> NaN Division_impossible
630remx992 remainder +0.100 9E+999999999               -> 0.100
631remx993 remainder 9E-999999999 +9.100               -> 9E-999999999
632remx995 remainder -1.23456789012345E-0 9E+999999999 -> -1.23456789 Inexact Rounded
633remx996 remainder 9E+999999999 -0.83456789012345E-0 -> NaN Division_impossible
634remx997 remainder -0.100 9E+999999999               -> -0.100
635remx998 remainder 9E-999999999 -9.100               -> 9E-999999999
636
637-- Null tests
638remx1000 remainder 10  # -> NaN Invalid_operation
639remx1001 remainder  # 10 -> NaN Invalid_operation
640
641