1------------------------------------------------------------------------
2-- remainderNear.decTest -- decimal remainder-near (IEEE 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
28rmnx001 remaindernear  1     1    ->  0
29rmnx002 remaindernear  2     1    ->  0
30rmnx003 remaindernear  1     2    ->  1
31rmnx004 remaindernear  2     2    ->  0
32rmnx005 remaindernear  0     1    ->  0
33rmnx006 remaindernear  0     2    ->  0
34rmnx007 remaindernear  1     3    ->  1
35rmnx008 remaindernear  2     3    -> -1
36rmnx009 remaindernear  3     3    ->  0
37
38rmnx010 remaindernear  2.4   1    ->  0.4
39rmnx011 remaindernear  2.4   -1   ->  0.4
40rmnx012 remaindernear  -2.4  1    ->  -0.4
41rmnx013 remaindernear  -2.4  -1   ->  -0.4
42rmnx014 remaindernear  2.40  1    ->  0.40
43rmnx015 remaindernear  2.400 1    ->  0.400
44rmnx016 remaindernear  2.4   2    ->  0.4
45rmnx017 remaindernear  2.400 2    ->  0.400
46rmnx018 remaindernear  2.    2    ->  0
47rmnx019 remaindernear  20    20   ->  0
48
49rmnx020 remaindernear  187   187    ->  0
50rmnx021 remaindernear  5     2      ->  1
51rmnx022 remaindernear  5     2.0    ->  1.0
52rmnx023 remaindernear  5     2.000  ->  1.000
53rmnx024 remaindernear  5     0.200  ->  0.000
54rmnx025 remaindernear  5     0.200  ->  0.000
55
56rmnx030 remaindernear  1     2      ->  1
57rmnx031 remaindernear  1     4      ->  1
58rmnx032 remaindernear  1     8      ->  1
59rmnx033 remaindernear  1     16     ->  1
60rmnx034 remaindernear  1     32     ->  1
61rmnx035 remaindernear  1     64     ->  1
62rmnx040 remaindernear  1    -2      ->  1
63rmnx041 remaindernear  1    -4      ->  1
64rmnx042 remaindernear  1    -8      ->  1
65rmnx043 remaindernear  1    -16     ->  1
66rmnx044 remaindernear  1    -32     ->  1
67rmnx045 remaindernear  1    -64     ->  1
68rmnx050 remaindernear -1     2      ->  -1
69rmnx051 remaindernear -1     4      ->  -1
70rmnx052 remaindernear -1     8      ->  -1
71rmnx053 remaindernear -1     16     ->  -1
72rmnx054 remaindernear -1     32     ->  -1
73rmnx055 remaindernear -1     64     ->  -1
74rmnx060 remaindernear -1    -2      ->  -1
75rmnx061 remaindernear -1    -4      ->  -1
76rmnx062 remaindernear -1    -8      ->  -1
77rmnx063 remaindernear -1    -16     ->  -1
78rmnx064 remaindernear -1    -32     ->  -1
79rmnx065 remaindernear -1    -64     ->  -1
80
81rmnx066 remaindernear  999999997     1  -> 0
82rmnx067 remaindernear  999999997.4   1  -> 0.4
83rmnx068 remaindernear  999999997.5   1  -> -0.5
84rmnx069 remaindernear  999999997.9   1  -> -0.1
85rmnx070 remaindernear  999999997.999 1  -> -0.001
86
87rmnx071 remaindernear  999999998     1  -> 0
88rmnx072 remaindernear  999999998.4   1  -> 0.4
89rmnx073 remaindernear  999999998.5   1  -> 0.5
90rmnx074 remaindernear  999999998.9   1  -> -0.1
91rmnx075 remaindernear  999999998.999 1  -> -0.001
92
93rmnx076 remaindernear  999999999     1  -> 0
94rmnx077 remaindernear  999999999.4   1  -> 0.4
95rmnx078 remaindernear  999999999.5   1  -> NaN Division_impossible
96rmnx079 remaindernear  999999999.9   1  -> NaN Division_impossible
97rmnx080 remaindernear  999999999.999 1  -> NaN Division_impossible
98
99precision: 6
100rmnx081 remaindernear  999999999     1  -> NaN Division_impossible
101rmnx082 remaindernear  99999999      1  -> NaN Division_impossible
102rmnx083 remaindernear  9999999       1  -> NaN Division_impossible
103rmnx084 remaindernear  999999        1  -> 0
104rmnx085 remaindernear  99999         1  -> 0
105rmnx086 remaindernear  9999          1  -> 0
106rmnx087 remaindernear  999           1  -> 0
107rmnx088 remaindernear  99            1  -> 0
108rmnx089 remaindernear  9             1  -> 0
109
110precision: 9
111rmnx090 remaindernear  0.            1  -> 0
112rmnx091 remaindernear  .0            1  -> 0.0
113rmnx092 remaindernear  0.00          1  -> 0.00
114rmnx093 remaindernear  0.00E+9       1  -> 0
115rmnx094 remaindernear  0.0000E-50    1  -> 0E-54
116
117
118-- Various flavours of remaindernear by 0
119precision: 9
120maxexponent: 999999999
121minexponent: -999999999
122rmnx101 remaindernear  0       0   -> NaN Division_undefined
123rmnx102 remaindernear  0      -0   -> NaN Division_undefined
124rmnx103 remaindernear -0       0   -> NaN Division_undefined
125rmnx104 remaindernear -0      -0   -> NaN Division_undefined
126rmnx105 remaindernear  0.0E5   0   -> NaN Division_undefined
127rmnx106 remaindernear  0.000   0   -> NaN Division_undefined
128-- [Some think this next group should be Division_by_zero exception,
129-- but IEEE 854 is explicit that it is Invalid operation .. for
130-- remaindernear-near, anyway]
131rmnx107 remaindernear  0.0001  0   -> NaN Invalid_operation
132rmnx108 remaindernear  0.01    0   -> NaN Invalid_operation
133rmnx109 remaindernear  0.1     0   -> NaN Invalid_operation
134rmnx110 remaindernear  1       0   -> NaN Invalid_operation
135rmnx111 remaindernear  1       0.0 -> NaN Invalid_operation
136rmnx112 remaindernear 10       0.0 -> NaN Invalid_operation
137rmnx113 remaindernear 1E+100   0.0 -> NaN Invalid_operation
138rmnx114 remaindernear 1E+1000  0   -> NaN Invalid_operation
139rmnx115 remaindernear  0.0001 -0   -> NaN Invalid_operation
140rmnx116 remaindernear  0.01   -0   -> NaN Invalid_operation
141rmnx119 remaindernear  0.1    -0   -> NaN Invalid_operation
142rmnx120 remaindernear  1      -0   -> NaN Invalid_operation
143rmnx121 remaindernear  1      -0.0 -> NaN Invalid_operation
144rmnx122 remaindernear 10      -0.0 -> NaN Invalid_operation
145rmnx123 remaindernear 1E+100  -0.0 -> NaN Invalid_operation
146rmnx124 remaindernear 1E+1000 -0   -> NaN Invalid_operation
147-- and zeros on left
148rmnx130 remaindernear  0      1   ->  0
149rmnx131 remaindernear  0     -1   ->  0
150rmnx132 remaindernear  0.0    1   ->  0.0
151rmnx133 remaindernear  0.0   -1   ->  0.0
152rmnx134 remaindernear -0      1   -> -0
153rmnx135 remaindernear -0     -1   -> -0
154rmnx136 remaindernear -0.0    1   -> -0.0
155rmnx137 remaindernear -0.0   -1   -> -0.0
156
157-- 0.5ers
158rmmx143 remaindernear   0.5  2     ->  0.5
159rmmx144 remaindernear   0.5  2.1   ->  0.5
160rmmx145 remaindernear   0.5  2.01  ->  0.50
161rmmx146 remaindernear   0.5  2.001 ->  0.500
162rmmx147 remaindernear   0.50 2     ->  0.50
163rmmx148 remaindernear   0.50 2.01  ->  0.50
164rmmx149 remaindernear   0.50 2.001 ->  0.500
165
166-- some differences from remainder
167rmnx150 remaindernear   0.4  1.020 ->  0.400
168rmnx151 remaindernear   0.50 1.020 ->  0.500
169rmnx152 remaindernear   0.51 1.020 ->  0.510
170rmnx153 remaindernear   0.52 1.020 -> -0.500
171rmnx154 remaindernear   0.6  1.020 -> -0.420
172rmnx155 remaindernear   0.49 1     ->  0.49
173rmnx156 remaindernear   0.50 1     ->  0.50
174rmnx157 remaindernear   1.50 1     -> -0.50
175rmnx158 remaindernear   2.50 1     ->  0.50
176rmnx159 remaindernear   9.50 1     -> -0.50
177rmnx160 remaindernear   0.51 1     -> -0.49
178
179-- the nasty division-by-1 cases
180rmnx161 remaindernear   0.4         1   ->  0.4
181rmnx162 remaindernear   0.45        1   ->  0.45
182rmnx163 remaindernear   0.455       1   ->  0.455
183rmnx164 remaindernear   0.4555      1   ->  0.4555
184rmnx165 remaindernear   0.45555     1   ->  0.45555
185rmnx166 remaindernear   0.455555    1   ->  0.455555
186rmnx167 remaindernear   0.4555555   1   ->  0.4555555
187rmnx168 remaindernear   0.45555555  1   ->  0.45555555
188rmnx169 remaindernear   0.455555555 1   ->  0.455555555
189-- with spill...
190rmnx171 remaindernear   0.5         1   ->  0.5
191rmnx172 remaindernear   0.55        1   -> -0.45
192rmnx173 remaindernear   0.555       1   -> -0.445
193rmnx174 remaindernear   0.5555      1   -> -0.4445
194rmnx175 remaindernear   0.55555     1   -> -0.44445
195rmnx176 remaindernear   0.555555    1   -> -0.444445
196rmnx177 remaindernear   0.5555555   1   -> -0.4444445
197rmnx178 remaindernear   0.55555555  1   -> -0.44444445
198rmnx179 remaindernear   0.555555555 1   -> -0.444444445
199
200-- progression
201rmnx180 remaindernear  1  1   -> 0
202rmnx181 remaindernear  1  2   -> 1
203rmnx182 remaindernear  1  3   -> 1
204rmnx183 remaindernear  1  4   -> 1
205rmnx184 remaindernear  1  5   -> 1
206rmnx185 remaindernear  1  6   -> 1
207rmnx186 remaindernear  1  7   -> 1
208rmnx187 remaindernear  1  8   -> 1
209rmnx188 remaindernear  1  9   -> 1
210rmnx189 remaindernear  1  10  -> 1
211rmnx190 remaindernear  1  1   -> 0
212rmnx191 remaindernear  2  1   -> 0
213rmnx192 remaindernear  3  1   -> 0
214rmnx193 remaindernear  4  1   -> 0
215rmnx194 remaindernear  5  1   -> 0
216rmnx195 remaindernear  6  1   -> 0
217rmnx196 remaindernear  7  1   -> 0
218rmnx197 remaindernear  8  1   -> 0
219rmnx198 remaindernear  9  1   -> 0
220rmnx199 remaindernear  10 1   -> 0
221
222
223-- Various flavours of remaindernear by 0
224maxexponent: 999999999
225minexponent: -999999999
226rmnx201 remaindernear  0      0   -> NaN Division_undefined
227rmnx202 remaindernear  0.0E5  0   -> NaN Division_undefined
228rmnx203 remaindernear  0.000  0   -> NaN Division_undefined
229rmnx204 remaindernear  0.0001 0   -> NaN Invalid_operation
230rmnx205 remaindernear  0.01   0   -> NaN Invalid_operation
231rmnx206 remaindernear  0.1    0   -> NaN Invalid_operation
232rmnx207 remaindernear  1      0   -> NaN Invalid_operation
233rmnx208 remaindernear  1      0.0 -> NaN Invalid_operation
234rmnx209 remaindernear 10      0.0 -> NaN Invalid_operation
235rmnx210 remaindernear 1E+100  0.0 -> NaN Invalid_operation
236rmnx211 remaindernear 1E+1000 0   -> NaN Invalid_operation
237
238-- tests from the extended specification
239rmnx221 remaindernear 2.1     3   -> -0.9
240rmnx222 remaindernear  10     6   -> -2
241rmnx223 remaindernear  10     3   ->  1
242rmnx224 remaindernear -10     3   -> -1
243rmnx225 remaindernear  10.2   1   -> 0.2
244rmnx226 remaindernear  10     0.3 -> 0.1
245rmnx227 remaindernear   3.6   1.3 -> -0.3
246
247-- some differences from remainder
248rmnx231 remaindernear   0.4  1.020 ->  0.400
249rmnx232 remaindernear   0.50 1.020 ->  0.500
250rmnx233 remaindernear   0.51 1.020 ->  0.510
251rmnx234 remaindernear   0.52 1.020 -> -0.500
252rmnx235 remaindernear   0.6  1.020 -> -0.420
253
254-- test some cases that are close to exponent overflow
255maxexponent: 999999999
256minexponent: -999999999
257rmnx270 remaindernear 1 1e999999999    -> 1
258rmnx271 remaindernear 1 0.9e999999999  -> 1
259rmnx272 remaindernear 1 0.99e999999999 -> 1
260rmnx273 remaindernear 1 0.999999999e999999999 -> 1
261rmnx274 remaindernear 9e999999999          1 -> NaN Division_impossible
262rmnx275 remaindernear 9.9e999999999        1 -> NaN Division_impossible
263rmnx276 remaindernear 9.99e999999999       1 -> NaN Division_impossible
264rmnx277 remaindernear 9.99999999e999999999 1 -> NaN Division_impossible
265
266rmnx280 remaindernear 0.1 9e-999999999       -> NaN Division_impossible
267rmnx281 remaindernear 0.1 99e-999999999      -> NaN Division_impossible
268rmnx282 remaindernear 0.1 999e-999999999     -> NaN Division_impossible
269
270rmnx283 remaindernear 0.1 9e-999999998       -> NaN Division_impossible
271rmnx284 remaindernear 0.1 99e-999999998      -> NaN Division_impossible
272rmnx285 remaindernear 0.1 999e-999999998     -> NaN Division_impossible
273rmnx286 remaindernear 0.1 999e-999999997     -> NaN Division_impossible
274rmnx287 remaindernear 0.1 9999e-999999997    -> NaN Division_impossible
275rmnx288 remaindernear 0.1 99999e-999999997   -> NaN Division_impossible
276
277-- rmnx3xx are from DiagBigDecimal
278rmnx301 remaindernear   1    3     ->  1
279rmnx302 remaindernear   5    5     ->  0
280rmnx303 remaindernear   13   10    ->  3
281rmnx304 remaindernear   13   50    ->  13
282rmnx305 remaindernear   13   100   ->  13
283rmnx306 remaindernear   13   1000  ->  13
284rmnx307 remaindernear   .13    1   ->  0.13
285rmnx308 remaindernear   0.133  1   ->  0.133
286rmnx309 remaindernear   0.1033 1   ->  0.1033
287rmnx310 remaindernear   1.033  1   ->  0.033
288rmnx311 remaindernear   10.33  1   ->  0.33
289rmnx312 remaindernear   10.33 10   ->  0.33
290rmnx313 remaindernear   103.3  1   ->  0.3
291rmnx314 remaindernear   133   10   ->  3
292rmnx315 remaindernear   1033  10   ->  3
293rmnx316 remaindernear   1033  50   -> -17
294rmnx317 remaindernear   101.0  3   -> -1.0
295rmnx318 remaindernear   102.0  3   ->  0.0
296rmnx319 remaindernear   103.0  3   ->  1.0
297rmnx320 remaindernear   2.40   1   ->  0.40
298rmnx321 remaindernear   2.400  1   ->  0.400
299rmnx322 remaindernear   2.4    1   ->  0.4
300rmnx323 remaindernear   2.4    2   ->  0.4
301rmnx324 remaindernear   2.400  2   ->  0.400
302rmnx325 remaindernear   1   0.3    ->  0.1
303rmnx326 remaindernear   1   0.30   ->  0.10
304rmnx327 remaindernear   1   0.300  ->  0.100
305rmnx328 remaindernear   1   0.3000 ->  0.1000
306rmnx329 remaindernear   1.0    0.3 ->  0.1
307rmnx330 remaindernear   1.00   0.3 ->  0.10
308rmnx331 remaindernear   1.000  0.3 ->  0.100
309rmnx332 remaindernear   1.0000 0.3 ->  0.1000
310rmnx333 remaindernear   0.5  2     ->  0.5
311rmnx334 remaindernear   0.5  2.1   ->  0.5
312rmnx335 remaindernear   0.5  2.01  ->  0.50
313rmnx336 remaindernear   0.5  2.001 ->  0.500
314rmnx337 remaindernear   0.50 2     ->  0.50
315rmnx338 remaindernear   0.50 2.01  ->  0.50
316rmnx339 remaindernear   0.50 2.001 ->  0.500
317
318rmnx340 remaindernear   0.5   0.5000001    ->  -1E-7
319rmnx341 remaindernear   0.5   0.50000001    ->  -1E-8
320rmnx342 remaindernear   0.5   0.500000001    ->  -1E-9
321rmnx343 remaindernear   0.5   0.5000000001    ->  -1E-10
322rmnx344 remaindernear   0.5   0.50000000001    ->  -1E-11
323rmnx345 remaindernear   0.5   0.4999999    ->  1E-7
324rmnx346 remaindernear   0.5   0.49999999    ->  1E-8
325rmnx347 remaindernear   0.5   0.499999999    ->  1E-9
326rmnx348 remaindernear   0.5   0.4999999999    ->  1E-10
327rmnx349 remaindernear   0.5   0.49999999999    ->  1E-11
328
329rmnx350 remaindernear   0.03  7  ->  0.03
330rmnx351 remaindernear   5   2    ->  1
331rmnx352 remaindernear   4.1   2    ->  0.1
332rmnx353 remaindernear   4.01   2    ->  0.01
333rmnx354 remaindernear   4.001   2    ->  0.001
334rmnx355 remaindernear   4.0001   2    ->  0.0001
335rmnx356 remaindernear   4.00001   2    ->  0.00001
336rmnx357 remaindernear   4.000001   2    ->  0.000001
337rmnx358 remaindernear   4.0000001   2    ->  1E-7
338
339rmnx360 remaindernear   1.2   0.7345 -> -0.2690
340rmnx361 remaindernear   0.8   12     ->  0.8
341rmnx362 remaindernear   0.8   0.2    ->  0.0
342rmnx363 remaindernear   0.8   0.3    -> -0.1
343rmnx364 remaindernear   0.800   12   ->  0.800
344rmnx365 remaindernear   0.800   1.7  ->  0.800
345rmnx366 remaindernear   2.400   2    ->  0.400
346
347precision: 6
348rmnx371 remaindernear   2.400  2        ->  0.400
349precision: 3
350rmnx372 remaindernear   12345678900000 12e+12 -> 3.46E+11 Inexact Rounded
351
352precision: 5
353rmnx381 remaindernear 12345  1         ->  0
354rmnx382 remaindernear 12345  1.0001    -> -0.2344
355rmnx383 remaindernear 12345  1.001     -> -0.333
356rmnx384 remaindernear 12345  1.01      -> -0.23
357rmnx385 remaindernear 12345  1.1       -> -0.3
358rmnx386 remaindernear 12355  4         -> -1
359rmnx387 remaindernear 12345  4         ->  1
360rmnx388 remaindernear 12355  4.0001    -> -1.3089
361rmnx389 remaindernear 12345  4.0001    ->  0.6914
362rmnx390 remaindernear 12345  4.9       ->  1.9
363rmnx391 remaindernear 12345  4.99      -> -0.26
364rmnx392 remaindernear 12345  4.999     ->  2.469
365rmnx393 remaindernear 12345  4.9999    ->  0.2469
366rmnx394 remaindernear 12345  5         ->  0
367rmnx395 remaindernear 12345  5.0001    -> -0.2469
368rmnx396 remaindernear 12345  5.001     -> -2.469
369rmnx397 remaindernear 12345  5.01      ->  0.36
370rmnx398 remaindernear 12345  5.1       -> -2.1
371
372precision: 9
373-- some nasty division-by-1 cases [some similar above]
374rmnx401 remaindernear   0.4         1   ->  0.4
375rmnx402 remaindernear   0.45        1   ->  0.45
376rmnx403 remaindernear   0.455       1   ->  0.455
377rmnx404 remaindernear   0.4555      1   ->  0.4555
378rmnx405 remaindernear   0.45555     1   ->  0.45555
379rmnx406 remaindernear   0.455555    1   ->  0.455555
380rmnx407 remaindernear   0.4555555   1   ->  0.4555555
381rmnx408 remaindernear   0.45555555  1   ->  0.45555555
382rmnx409 remaindernear   0.455555555 1   ->  0.455555555
383
384-- some tricky LHSs
385rmnx420 remaindernear   99999999.999999999   1E+8   -> -1E-9
386rmnx421 remaindernear  999999999.999999999   1E+9   -> -1E-9
387precision: 9
388rmnx430 remaindernear   0.455555555 1   ->  0.455555555
389precision: 8
390rmnx431 remaindernear   0.455555555 1   ->  0.45555556 Inexact Rounded
391precision: 7
392rmnx432 remaindernear   0.455555555 1   ->  0.4555556  Inexact Rounded
393precision: 6
394rmnx433 remaindernear   0.455555555 1   ->  0.455556   Inexact Rounded
395precision: 5
396rmnx434 remaindernear   0.455555555 1   ->  0.45556    Inexact Rounded
397precision: 4
398rmnx435 remaindernear   0.455555555 1   ->  0.4556     Inexact Rounded
399precision: 3
400rmnx436 remaindernear   0.455555555 1   ->  0.456      Inexact Rounded
401precision: 2
402rmnx437 remaindernear   0.455555555 1   ->  0.46       Inexact Rounded
403precision: 1
404rmnx438 remaindernear   0.455555555 1   ->  0.5        Inexact Rounded
405
406-- early tests; from text descriptions
407precision: 9
408rmnx601 remaindernear  10   6  -> -2
409rmnx602 remaindernear -10   6  -> 2
410rmnx603 remaindernear  11   3  -> -1
411rmnx604 remaindernear  11   5  -> 1
412rmnx605 remaindernear   7.7 8  -> -0.3
413rmnx606 remaindernear  31.5 3  -> 1.5    -- i=10
414rmnx607 remaindernear  34.5 3  -> -1.5   -- i=11
415
416-- zero signs
417rmnx650 remaindernear  1  1 ->  0
418rmnx651 remaindernear -1  1 -> -0
419rmnx652 remaindernear  1 -1 ->  0
420rmnx653 remaindernear -1 -1 -> -0
421rmnx654 remaindernear  0  1 ->  0
422rmnx655 remaindernear -0  1 -> -0
423rmnx656 remaindernear  0 -1 ->  0
424rmnx657 remaindernear -0 -1 -> -0
425rmnx658 remaindernear  0.00  1  ->  0.00
426rmnx659 remaindernear -0.00  1  -> -0.00
427
428-- Specials
429rmnx680 remaindernear  Inf  -Inf   ->  NaN Invalid_operation
430rmnx681 remaindernear  Inf  -1000  ->  NaN Invalid_operation
431rmnx682 remaindernear  Inf  -1     ->  NaN Invalid_operation
432rmnx683 remaindernear  Inf   0     ->  NaN Invalid_operation
433rmnx684 remaindernear  Inf  -0     ->  NaN Invalid_operation
434rmnx685 remaindernear  Inf   1     ->  NaN Invalid_operation
435rmnx686 remaindernear  Inf   1000  ->  NaN Invalid_operation
436rmnx687 remaindernear  Inf   Inf   ->  NaN Invalid_operation
437rmnx688 remaindernear -1000  Inf   -> -1000
438rmnx689 remaindernear -Inf   Inf   ->  NaN Invalid_operation
439rmnx691 remaindernear -1     Inf   -> -1
440rmnx692 remaindernear  0     Inf   ->  0
441rmnx693 remaindernear -0     Inf   -> -0
442rmnx694 remaindernear  1     Inf   ->  1
443rmnx695 remaindernear  1000  Inf   ->  1000
444rmnx696 remaindernear  Inf   Inf   ->  NaN Invalid_operation
445
446rmnx700 remaindernear -Inf  -Inf   ->  NaN Invalid_operation
447rmnx701 remaindernear -Inf  -1000  ->  NaN Invalid_operation
448rmnx702 remaindernear -Inf  -1     ->  NaN Invalid_operation
449rmnx703 remaindernear -Inf  -0     ->  NaN Invalid_operation
450rmnx704 remaindernear -Inf   0     ->  NaN Invalid_operation
451rmnx705 remaindernear -Inf   1     ->  NaN Invalid_operation
452rmnx706 remaindernear -Inf   1000  ->  NaN Invalid_operation
453rmnx707 remaindernear -Inf   Inf   ->  NaN Invalid_operation
454rmnx708 remaindernear -Inf  -Inf   ->  NaN Invalid_operation
455rmnx709 remaindernear -1000  Inf   -> -1000
456rmnx710 remaindernear -1    -Inf   -> -1
457rmnx711 remaindernear -0    -Inf   -> -0
458rmnx712 remaindernear  0    -Inf   ->  0
459rmnx713 remaindernear  1    -Inf   ->  1
460rmnx714 remaindernear  1000 -Inf   ->  1000
461rmnx715 remaindernear  Inf  -Inf   ->  NaN Invalid_operation
462
463rmnx721 remaindernear  NaN -Inf    ->  NaN
464rmnx722 remaindernear  NaN -1000   ->  NaN
465rmnx723 remaindernear  NaN -1      ->  NaN
466rmnx724 remaindernear  NaN -0      ->  NaN
467rmnx725 remaindernear  NaN  0      ->  NaN
468rmnx726 remaindernear  NaN  1      ->  NaN
469rmnx727 remaindernear  NaN  1000   ->  NaN
470rmnx728 remaindernear  NaN  Inf    ->  NaN
471rmnx729 remaindernear  NaN  NaN    ->  NaN
472rmnx730 remaindernear -Inf  NaN    ->  NaN
473rmnx731 remaindernear -1000 NaN    ->  NaN
474rmnx732 remaindernear -1   -NaN    -> -NaN
475rmnx733 remaindernear -0    NaN    ->  NaN
476rmnx734 remaindernear  0    NaN    ->  NaN
477rmnx735 remaindernear  1    NaN    ->  NaN
478rmnx736 remaindernear  1000 NaN    ->  NaN
479rmnx737 remaindernear  Inf  NaN    ->  NaN
480
481rmnx741 remaindernear  sNaN -Inf   ->  NaN  Invalid_operation
482rmnx742 remaindernear  sNaN -1000  ->  NaN  Invalid_operation
483rmnx743 remaindernear -sNaN -1     -> -NaN  Invalid_operation
484rmnx744 remaindernear  sNaN -0     ->  NaN  Invalid_operation
485rmnx745 remaindernear  sNaN  0     ->  NaN  Invalid_operation
486rmnx746 remaindernear  sNaN  1     ->  NaN  Invalid_operation
487rmnx747 remaindernear  sNaN  1000  ->  NaN  Invalid_operation
488rmnx749 remaindernear  sNaN  NaN   ->  NaN  Invalid_operation
489rmnx750 remaindernear  sNaN sNaN   ->  NaN  Invalid_operation
490rmnx751 remaindernear  NaN  sNaN   ->  NaN  Invalid_operation
491rmnx752 remaindernear -Inf  sNaN   ->  NaN  Invalid_operation
492rmnx753 remaindernear -1000 sNaN   ->  NaN  Invalid_operation
493rmnx754 remaindernear -1    sNaN   ->  NaN  Invalid_operation
494rmnx755 remaindernear -0   -sNaN   -> -NaN  Invalid_operation
495rmnx756 remaindernear  0    sNaN   ->  NaN  Invalid_operation
496rmnx757 remaindernear  1    sNaN   ->  NaN  Invalid_operation
497rmnx758 remaindernear  1000 sNaN   ->  NaN  Invalid_operation
498rmnx759 remaindernear  Inf  sNaN   ->  NaN  Invalid_operation
499rmnx760 remaindernear  NaN  sNaN   ->  NaN  Invalid_operation
500
501-- propaging NaNs
502rmnx761 remaindernear  NaN1   NaN7   ->  NaN1
503rmnx762 remaindernear sNaN2   NaN8   ->  NaN2 Invalid_operation
504rmnx763 remaindernear  NaN3 -sNaN9   -> -NaN9 Invalid_operation
505rmnx764 remaindernear sNaN4  sNaN10  ->  NaN4 Invalid_operation
506rmnx765 remaindernear    15   NaN11  ->  NaN11
507rmnx766 remaindernear  NaN6   NaN12  ->  NaN6
508rmnx767 remaindernear  Inf   -NaN13  -> -NaN13
509rmnx768 remaindernear  NaN14  -Inf   ->  NaN14
510rmnx769 remaindernear    0    NaN15  ->  NaN15
511rmnx770 remaindernear -NaN16   -0    -> -NaN16
512
513-- test some cases that are close to exponent overflow
514maxexponent: 999999999
515minexponent: -999999999
516rmnx780 remaindernear 1 1e999999999    -> 1
517rmnx781 remaindernear 1 0.9e999999999  -> 1
518rmnx782 remaindernear 1 0.99e999999999 -> 1
519rmnx783 remaindernear 1 0.999999999e999999999 -> 1
520rmnx784 remaindernear 9e999999999          1 -> NaN Division_impossible
521rmnx785 remaindernear 9.9e999999999        1 -> NaN Division_impossible
522rmnx786 remaindernear 9.99e999999999       1 -> NaN Division_impossible
523rmnx787 remaindernear 9.99999999e999999999 1 -> NaN Division_impossible
524
525
526-- overflow and underflow tests [from divide]
527precision: 9
528maxexponent: 999999999
529minexponent: -999999999
530rmnx790 remaindernear +1.23456789012345E-0 9E+999999999 -> 1.23456789 Inexact Rounded
531rmnx791 remaindernear 9E+999999999 +0.23456789012345E-0 -> NaN Division_impossible
532rmnx792 remaindernear +0.100 9E+999999999               -> 0.100
533rmnx793 remaindernear 9E-999999999 +9.100               -> 9E-999999999
534rmnx795 remaindernear -1.23456789012345E-0 9E+999999999 -> -1.23456789 Inexact Rounded
535rmnx796 remaindernear 9E+999999999 -0.83456789012345E-0 -> NaN Division_impossible
536rmnx797 remaindernear -0.100 9E+999999999               -> -0.100
537rmnx798 remaindernear 9E-999999999 -9.100               -> 9E-999999999
538
539-- long operands checks
540maxexponent: 999
541minexponent: -999
542precision: 9
543rmnx801 remaindernear 12345678000 100 -> 0
544rmnx802 remaindernear 1 12345678000   -> 1
545rmnx803 remaindernear 1234567800  10  -> 0
546rmnx804 remaindernear 1 1234567800    -> 1
547rmnx805 remaindernear 1234567890  10  -> 0
548rmnx806 remaindernear 1 1234567890    -> 1
549rmnx807 remaindernear 1234567891  10  -> 1
550rmnx808 remaindernear 1 1234567891    -> 1
551rmnx809 remaindernear 12345678901 100 -> 1
552rmnx810 remaindernear 1 12345678901   -> 1
553rmnx811 remaindernear 1234567896  10  -> -4
554rmnx812 remaindernear 1 1234567896    -> 1
555
556precision: 15
557rmnx841 remaindernear 12345678000 100 -> 0
558rmnx842 remaindernear 1 12345678000   -> 1
559rmnx843 remaindernear 1234567800  10  -> 0
560rmnx844 remaindernear 1 1234567800    -> 1
561rmnx845 remaindernear 1234567890  10  -> 0
562rmnx846 remaindernear 1 1234567890    -> 1
563rmnx847 remaindernear 1234567891  10  -> 1
564rmnx848 remaindernear 1 1234567891    -> 1
565rmnx849 remaindernear 12345678901 100 -> 1
566rmnx850 remaindernear 1 12345678901   -> 1
567rmnx851 remaindernear 1234567896  10  -> -4
568rmnx852 remaindernear 1 1234567896    -> 1
569
570-- Null tests
571rmnx900 remaindernear 10  # -> NaN Invalid_operation
572rmnx901 remaindernear  # 10 -> NaN Invalid_operation
573