• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1------------------------------------------------------------------------
2-- nexttoward.decTest -- decimal next toward rhs [754r nextafter]     --
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 check with a scattering of numerics
29nextt001 nexttoward   10    10   ->  10
30nextt002 nexttoward  -10   -10   -> -10
31nextt003 nexttoward   1     10   ->  1.00000001
32nextt004 nexttoward   1    -10   ->  0.999999999
33nextt005 nexttoward  -1     10   -> -0.999999999
34nextt006 nexttoward  -1    -10   -> -1.00000001
35nextt007 nexttoward   0     10   ->  1E-391       Underflow Subnormal Inexact Rounded
36nextt008 nexttoward   0    -10   -> -1E-391       Underflow Subnormal Inexact Rounded
37nextt009 nexttoward   9.99999999E+384 +Infinity ->  Infinity Overflow Inexact Rounded
38nextt010 nexttoward  -9.99999999E+384 -Infinity -> -Infinity Overflow Inexact Rounded
39
40------- lhs=rhs
41-- finites
42nextt101 nexttoward          7       7 ->  7
43nextt102 nexttoward         -7      -7 -> -7
44nextt103 nexttoward         75      75 ->  75
45nextt104 nexttoward        -75     -75 -> -75
46nextt105 nexttoward       7.50     7.5 ->  7.50
47nextt106 nexttoward      -7.50   -7.50 -> -7.50
48nextt107 nexttoward       7.500 7.5000 ->  7.500
49nextt108 nexttoward      -7.500   -7.5 -> -7.500
50
51-- zeros
52nextt111 nexttoward          0       0 ->  0
53nextt112 nexttoward         -0      -0 -> -0
54nextt113 nexttoward       0E+4       0 ->  0E+4
55nextt114 nexttoward      -0E+4      -0 -> -0E+4
56nextt115 nexttoward     0.0000 0.00000 ->  0.0000
57nextt116 nexttoward    -0.0000   -0.00 -> -0.0000
58nextt117 nexttoward      0E-141      0 ->  0E-141
59nextt118 nexttoward     -0E-141   -000 -> -0E-141
60
61-- full coefficients, alternating bits
62nextt121 nexttoward   268268268    268268268 ->   268268268
63nextt122 nexttoward  -268268268   -268268268 ->  -268268268
64nextt123 nexttoward   134134134    134134134 ->   134134134
65nextt124 nexttoward  -134134134   -134134134 ->  -134134134
66
67-- Nmax, Nmin, Ntiny
68nextt131 nexttoward  9.99999999E+384  9.99999999E+384   ->   9.99999999E+384
69nextt132 nexttoward  1E-383           1E-383            ->   1E-383
70nextt133 nexttoward  1.00000000E-383  1.00000000E-383   ->   1.00000000E-383
71nextt134 nexttoward  1E-391           1E-391            ->   1E-391
72
73nextt135 nexttoward  -1E-391          -1E-391           ->  -1E-391
74nextt136 nexttoward  -1.00000000E-383 -1.00000000E-383  ->  -1.00000000E-383
75nextt137 nexttoward  -1E-383          -1E-383           ->  -1E-383
76nextt138 nexttoward  -9.99999999E+384 -9.99999999E+384  ->  -9.99999999E+384
77
78------- lhs<rhs
79nextt201 nexttoward  0.999999995 Infinity ->   0.999999996
80nextt202 nexttoward  0.999999996 Infinity ->   0.999999997
81nextt203 nexttoward  0.999999997 Infinity ->   0.999999998
82nextt204 nexttoward  0.999999998 Infinity ->   0.999999999
83nextt205 nexttoward  0.999999999 Infinity ->   1.00000000
84nextt206 nexttoward  1.00000000  Infinity ->   1.00000001
85nextt207 nexttoward  1.0         Infinity ->   1.00000001
86nextt208 nexttoward  1           Infinity ->   1.00000001
87nextt209 nexttoward  1.00000001  Infinity ->   1.00000002
88nextt210 nexttoward  1.00000002  Infinity ->   1.00000003
89nextt211 nexttoward  1.00000003  Infinity ->   1.00000004
90nextt212 nexttoward  1.00000004  Infinity ->   1.00000005
91nextt213 nexttoward  1.00000005  Infinity ->   1.00000006
92nextt214 nexttoward  1.00000006  Infinity ->   1.00000007
93nextt215 nexttoward  1.00000007  Infinity ->   1.00000008
94nextt216 nexttoward  1.00000008  Infinity ->   1.00000009
95nextt217 nexttoward  1.00000009  Infinity ->   1.00000010
96nextt218 nexttoward  1.00000010  Infinity ->   1.00000011
97nextt219 nexttoward  1.00000011  Infinity ->   1.00000012
98
99nextt221 nexttoward -0.999999995 Infinity ->  -0.999999994
100nextt222 nexttoward -0.999999996 Infinity ->  -0.999999995
101nextt223 nexttoward -0.999999997 Infinity ->  -0.999999996
102nextt224 nexttoward -0.999999998 Infinity ->  -0.999999997
103nextt225 nexttoward -0.999999999 Infinity ->  -0.999999998
104nextt226 nexttoward -1.00000000  Infinity ->  -0.999999999
105nextt227 nexttoward -1.0         Infinity ->  -0.999999999
106nextt228 nexttoward -1           Infinity ->  -0.999999999
107nextt229 nexttoward -1.00000001  Infinity ->  -1.00000000
108nextt230 nexttoward -1.00000002  Infinity ->  -1.00000001
109nextt231 nexttoward -1.00000003  Infinity ->  -1.00000002
110nextt232 nexttoward -1.00000004  Infinity ->  -1.00000003
111nextt233 nexttoward -1.00000005  Infinity ->  -1.00000004
112nextt234 nexttoward -1.00000006  Infinity ->  -1.00000005
113nextt235 nexttoward -1.00000007  Infinity ->  -1.00000006
114nextt236 nexttoward -1.00000008  Infinity ->  -1.00000007
115nextt237 nexttoward -1.00000009  Infinity ->  -1.00000008
116nextt238 nexttoward -1.00000010  Infinity ->  -1.00000009
117nextt239 nexttoward -1.00000011  Infinity ->  -1.00000010
118nextt240 nexttoward -1.00000012  Infinity ->  -1.00000011
119
120-- input operand is >precision
121nextt241 nexttoward  1.00000010998  Infinity ->   1.00000011
122nextt242 nexttoward  1.00000010999  Infinity ->   1.00000011
123nextt243 nexttoward  1.00000011000  Infinity ->   1.00000012
124nextt244 nexttoward  1.00000011001  Infinity ->   1.00000012
125nextt245 nexttoward  1.00000011002  Infinity ->   1.00000012
126nextt246 nexttoward  1.00000011002  Infinity ->   1.00000012
127nextt247 nexttoward  1.00000011052  Infinity ->   1.00000012
128nextt248 nexttoward  1.00000011552  Infinity ->   1.00000012
129nextt249 nexttoward -1.00000010998  Infinity ->  -1.00000010
130nextt250 nexttoward -1.00000010999  Infinity ->  -1.00000010
131nextt251 nexttoward -1.00000011000  Infinity ->  -1.00000010
132nextt252 nexttoward -1.00000011001  Infinity ->  -1.00000011
133nextt253 nexttoward -1.00000011002  Infinity ->  -1.00000011
134nextt254 nexttoward -1.00000011002  Infinity ->  -1.00000011
135nextt255 nexttoward -1.00000011052  Infinity ->  -1.00000011
136nextt256 nexttoward -1.00000011552  Infinity ->  -1.00000011
137-- ultra-tiny inputs
138nextt260 nexttoward  1E-99999       Infinity ->   1E-391          Underflow Subnormal Inexact Rounded
139nextt261 nexttoward  1E-999999999   Infinity ->   1E-391          Underflow Subnormal Inexact Rounded
140nextt262 nexttoward  1E-391         Infinity ->   2E-391          Underflow Subnormal Inexact Rounded
141nextt263 nexttoward -1E-99999       Infinity ->  -0E-391          Underflow Subnormal Inexact Rounded Clamped
142nextt264 nexttoward -1E-999999999   Infinity ->  -0E-391          Underflow Subnormal Inexact Rounded Clamped
143nextt265 nexttoward -1E-391         Infinity ->  -0E-391          Underflow Subnormal Inexact Rounded Clamped
144
145-- Zeros
146nextt300 nexttoward  0           Infinity ->  1E-391              Underflow Subnormal Inexact Rounded
147nextt301 nexttoward  0.00        Infinity ->  1E-391              Underflow Subnormal Inexact Rounded
148nextt302 nexttoward  0E-300      Infinity ->  1E-391              Underflow Subnormal Inexact Rounded
149nextt303 nexttoward  0E+300      Infinity ->  1E-391              Underflow Subnormal Inexact Rounded
150nextt304 nexttoward  0E+30000    Infinity ->  1E-391              Underflow Subnormal Inexact Rounded
151nextt305 nexttoward -0           Infinity ->  1E-391              Underflow Subnormal Inexact Rounded
152nextt306 nexttoward -0.00        Infinity ->  1E-391              Underflow Subnormal Inexact Rounded
153nextt307 nexttoward -0E-300      Infinity ->  1E-391              Underflow Subnormal Inexact Rounded
154nextt308 nexttoward -0E+300      Infinity ->  1E-391              Underflow Subnormal Inexact Rounded
155nextt309 nexttoward -0E+30000    Infinity ->  1E-391              Underflow Subnormal Inexact Rounded
156
157-- specials
158nextt350 nexttoward   Inf    Infinity ->  Infinity
159nextt351 nexttoward  -Inf    Infinity -> -9.99999999E+384
160nextt352 nexttoward   NaN    Infinity ->  NaN
161nextt353 nexttoward  sNaN    Infinity ->  NaN   Invalid_operation
162nextt354 nexttoward   NaN77  Infinity ->  NaN77
163nextt355 nexttoward  sNaN88  Infinity ->  NaN88 Invalid_operation
164nextt356 nexttoward  -NaN    Infinity -> -NaN
165nextt357 nexttoward -sNaN    Infinity -> -NaN   Invalid_operation
166nextt358 nexttoward  -NaN77  Infinity -> -NaN77
167nextt359 nexttoward -sNaN88  Infinity -> -NaN88 Invalid_operation
168
169-- Nmax, Nmin, Ntiny, subnormals
170maxExponent: 999
171minexponent: -999
172nextt370 nexttoward  9.99999999E+999   Infinity -> Infinity        Overflow Inexact Rounded
173nextt371 nexttoward  9.99999998E+999   Infinity -> 9.99999999E+999
174nextt372 nexttoward  1E-999            Infinity -> 1.00000001E-999
175nextt373 nexttoward  1.00000000E-999   Infinity -> 1.00000001E-999
176nextt374 nexttoward  0.999999999E-999  Infinity -> 1.00000000E-999
177nextt375 nexttoward  0.99999999E-999   Infinity -> 1.00000000E-999
178nextt376 nexttoward  9E-1007           Infinity -> 1.0E-1006       Underflow Subnormal Inexact Rounded
179nextt377 nexttoward  9.9E-1006         Infinity -> 1.00E-1005      Underflow Subnormal Inexact Rounded
180nextt378 nexttoward  9.9999E-1003      Infinity -> 1.00000E-1002   Underflow Subnormal Inexact Rounded
181nextt379 nexttoward  9.9999998E-1000   Infinity -> 9.9999999E-1000 Underflow Subnormal Inexact Rounded
182nextt380 nexttoward  9.9999997E-1000   Infinity -> 9.9999998E-1000 Underflow Subnormal Inexact Rounded
183nextt381 nexttoward  0E-1007           Infinity -> 1E-1007         Underflow Subnormal Inexact Rounded
184nextt382 nexttoward  1E-1007           Infinity -> 2E-1007         Underflow Subnormal Inexact Rounded
185nextt383 nexttoward  2E-1007           Infinity -> 3E-1007         Underflow Subnormal Inexact Rounded
186
187nextt385 nexttoward  -0E-1007          Infinity ->  1E-1007        Underflow Subnormal Inexact Rounded
188nextt386 nexttoward  -1E-1007          Infinity -> -0E-1007        Underflow Subnormal Inexact Rounded Clamped
189nextt387 nexttoward  -2E-1007          Infinity -> -1E-1007        Underflow Subnormal Inexact Rounded
190nextt388 nexttoward  -10E-1007         Infinity -> -9E-1007        Underflow Subnormal Inexact Rounded
191nextt389 nexttoward  -100E-1007        Infinity -> -9.9E-1006      Underflow Subnormal Inexact Rounded
192nextt390 nexttoward  -100000E-1007     Infinity -> -9.9999E-1003   Underflow Subnormal Inexact Rounded
193nextt391 nexttoward  -1.0000E-999      Infinity -> -9.9999999E-1000  Underflow Subnormal Inexact Rounded
194nextt392 nexttoward  -1.00000000E-999  Infinity -> -9.9999999E-1000  Underflow Subnormal Inexact Rounded
195nextt393 nexttoward  -1E-999           Infinity -> -9.9999999E-1000  Underflow Subnormal Inexact Rounded
196nextt394 nexttoward  -9.99999998E+999  Infinity -> -9.99999997E+999
197nextt395 nexttoward  -9.99999999E+999  Infinity -> -9.99999998E+999
198
199------- lhs>rhs
200maxExponent: 384
201minexponent: -383
202nextt401 nexttoward  0.999999995  -Infinity ->   0.999999994
203nextt402 nexttoward  0.999999996  -Infinity ->   0.999999995
204nextt403 nexttoward  0.999999997  -Infinity ->   0.999999996
205nextt404 nexttoward  0.999999998  -Infinity ->   0.999999997
206nextt405 nexttoward  0.999999999  -Infinity ->   0.999999998
207nextt406 nexttoward  1.00000000   -Infinity ->   0.999999999
208nextt407 nexttoward  1.0          -Infinity ->   0.999999999
209nextt408 nexttoward  1            -Infinity ->   0.999999999
210nextt409 nexttoward  1.00000001   -Infinity ->   1.00000000
211nextt410 nexttoward  1.00000002   -Infinity ->   1.00000001
212nextt411 nexttoward  1.00000003   -Infinity ->   1.00000002
213nextt412 nexttoward  1.00000004   -Infinity ->   1.00000003
214nextt413 nexttoward  1.00000005   -Infinity ->   1.00000004
215nextt414 nexttoward  1.00000006   -Infinity ->   1.00000005
216nextt415 nexttoward  1.00000007   -Infinity ->   1.00000006
217nextt416 nexttoward  1.00000008   -Infinity ->   1.00000007
218nextt417 nexttoward  1.00000009   -Infinity ->   1.00000008
219nextt418 nexttoward  1.00000010   -Infinity ->   1.00000009
220nextt419 nexttoward  1.00000011   -Infinity ->   1.00000010
221nextt420 nexttoward  1.00000012   -Infinity ->   1.00000011
222
223nextt421 nexttoward -0.999999995  -Infinity ->  -0.999999996
224nextt422 nexttoward -0.999999996  -Infinity ->  -0.999999997
225nextt423 nexttoward -0.999999997  -Infinity ->  -0.999999998
226nextt424 nexttoward -0.999999998  -Infinity ->  -0.999999999
227nextt425 nexttoward -0.999999999  -Infinity ->  -1.00000000
228nextt426 nexttoward -1.00000000   -Infinity ->  -1.00000001
229nextt427 nexttoward -1.0          -Infinity ->  -1.00000001
230nextt428 nexttoward -1            -Infinity ->  -1.00000001
231nextt429 nexttoward -1.00000001   -Infinity ->  -1.00000002
232nextt430 nexttoward -1.00000002   -Infinity ->  -1.00000003
233nextt431 nexttoward -1.00000003   -Infinity ->  -1.00000004
234nextt432 nexttoward -1.00000004   -Infinity ->  -1.00000005
235nextt433 nexttoward -1.00000005   -Infinity ->  -1.00000006
236nextt434 nexttoward -1.00000006   -Infinity ->  -1.00000007
237nextt435 nexttoward -1.00000007   -Infinity ->  -1.00000008
238nextt436 nexttoward -1.00000008   -Infinity ->  -1.00000009
239nextt437 nexttoward -1.00000009   -Infinity ->  -1.00000010
240nextt438 nexttoward -1.00000010   -Infinity ->  -1.00000011
241nextt439 nexttoward -1.00000011   -Infinity ->  -1.00000012
242
243-- input operand is >precision
244nextt441 nexttoward  1.00000010998   -Infinity ->   1.00000010
245nextt442 nexttoward  1.00000010999   -Infinity ->   1.00000010
246nextt443 nexttoward  1.00000011000   -Infinity ->   1.00000010
247nextt444 nexttoward  1.00000011001   -Infinity ->   1.00000011
248nextt445 nexttoward  1.00000011002   -Infinity ->   1.00000011
249nextt446 nexttoward  1.00000011002   -Infinity ->   1.00000011
250nextt447 nexttoward  1.00000011052   -Infinity ->   1.00000011
251nextt448 nexttoward  1.00000011552   -Infinity ->   1.00000011
252nextt449 nexttoward -1.00000010998   -Infinity ->  -1.00000011
253nextt450 nexttoward -1.00000010999   -Infinity ->  -1.00000011
254nextt451 nexttoward -1.00000011000   -Infinity ->  -1.00000012
255nextt452 nexttoward -1.00000011001   -Infinity ->  -1.00000012
256nextt453 nexttoward -1.00000011002   -Infinity ->  -1.00000012
257nextt454 nexttoward -1.00000011002   -Infinity ->  -1.00000012
258nextt455 nexttoward -1.00000011052   -Infinity ->  -1.00000012
259nextt456 nexttoward -1.00000011552   -Infinity ->  -1.00000012
260-- ultra-tiny inputs
261nextt460 nexttoward  1E-99999        -Infinity ->   0E-391     Underflow Subnormal Inexact Rounded Clamped
262nextt461 nexttoward  1E-999999999    -Infinity ->   0E-391     Underflow Subnormal Inexact Rounded Clamped
263nextt462 nexttoward  1E-391          -Infinity ->   0E-391     Underflow Subnormal Inexact Rounded Clamped
264nextt463 nexttoward -1E-99999        -Infinity ->  -1E-391     Underflow Subnormal Inexact Rounded
265nextt464 nexttoward -1E-999999999    -Infinity ->  -1E-391     Underflow Subnormal Inexact Rounded
266nextt465 nexttoward -1E-391          -Infinity ->  -2E-391     Underflow Subnormal Inexact Rounded
267
268-- Zeros
269nextt500 nexttoward -0            -Infinity -> -1E-391         Underflow Subnormal Inexact Rounded
270nextt501 nexttoward  0            -Infinity -> -1E-391         Underflow Subnormal Inexact Rounded
271nextt502 nexttoward  0.00         -Infinity -> -1E-391         Underflow Subnormal Inexact Rounded
272nextt503 nexttoward -0.00         -Infinity -> -1E-391         Underflow Subnormal Inexact Rounded
273nextt504 nexttoward  0E-300       -Infinity -> -1E-391         Underflow Subnormal Inexact Rounded
274nextt505 nexttoward  0E+300       -Infinity -> -1E-391         Underflow Subnormal Inexact Rounded
275nextt506 nexttoward  0E+30000     -Infinity -> -1E-391         Underflow Subnormal Inexact Rounded
276nextt507 nexttoward -0E+30000     -Infinity -> -1E-391         Underflow Subnormal Inexact Rounded
277nextt508 nexttoward  0.00         -0.0000   -> -0.00
278
279-- specials
280nextt550 nexttoward   Inf     -Infinity ->  9.99999999E+384
281nextt551 nexttoward  -Inf     -Infinity -> -Infinity
282nextt552 nexttoward   NaN     -Infinity ->  NaN
283nextt553 nexttoward  sNaN     -Infinity ->  NaN   Invalid_operation
284nextt554 nexttoward   NaN77   -Infinity ->  NaN77
285nextt555 nexttoward  sNaN88   -Infinity ->  NaN88 Invalid_operation
286nextt556 nexttoward  -NaN     -Infinity -> -NaN
287nextt557 nexttoward -sNaN     -Infinity -> -NaN   Invalid_operation
288nextt558 nexttoward  -NaN77   -Infinity -> -NaN77
289nextt559 nexttoward -sNaN88   -Infinity -> -NaN88 Invalid_operation
290
291-- Nmax, Nmin, Ntiny, subnormals
292maxExponent: 999
293minexponent: -999
294nextt570 nexttoward  9.99999999E+999    -Infinity -> 9.99999998E+999
295nextt571 nexttoward  9.99999998E+999    -Infinity -> 9.99999997E+999
296nextt572 nexttoward  1E-999             -Infinity -> 9.9999999E-1000 Underflow Subnormal Inexact Rounded
297nextt573 nexttoward  1.00000000E-999    -Infinity -> 9.9999999E-1000 Underflow Subnormal Inexact Rounded
298nextt574 nexttoward  9E-1007            -Infinity -> 8E-1007         Underflow Subnormal Inexact Rounded
299nextt575 nexttoward  9.9E-1006          -Infinity -> 9.8E-1006       Underflow Subnormal Inexact Rounded
300nextt576 nexttoward  9.9999E-1003       -Infinity -> 9.9998E-1003    Underflow Subnormal Inexact Rounded
301nextt577 nexttoward  9.9999999E-1000    -Infinity -> 9.9999998E-1000 Underflow Subnormal Inexact Rounded
302nextt578 nexttoward  9.9999998E-1000    -Infinity -> 9.9999997E-1000 Underflow Subnormal Inexact Rounded
303nextt579 nexttoward  9.9999997E-1000    -Infinity -> 9.9999996E-1000 Underflow Subnormal Inexact Rounded
304nextt580 nexttoward  0E-1007            -Infinity -> -1E-1007        Underflow Subnormal Inexact Rounded
305nextt581 nexttoward  1E-1007            -Infinity -> 0E-1007         Underflow Subnormal Inexact Rounded Clamped
306nextt582 nexttoward  2E-1007            -Infinity -> 1E-1007         Underflow Subnormal Inexact Rounded
307
308nextt583 nexttoward  -0E-1007           -Infinity -> -1E-1007        Underflow Subnormal Inexact Rounded
309nextt584 nexttoward  -1E-1007           -Infinity -> -2E-1007        Underflow Subnormal Inexact Rounded
310nextt585 nexttoward  -2E-1007           -Infinity -> -3E-1007        Underflow Subnormal Inexact Rounded
311nextt586 nexttoward  -10E-1007          -Infinity -> -1.1E-1006      Underflow Subnormal Inexact Rounded
312nextt587 nexttoward  -100E-1007         -Infinity -> -1.01E-1005     Underflow Subnormal Inexact Rounded
313nextt588 nexttoward  -100000E-1007      -Infinity -> -1.00001E-1002  Underflow Subnormal Inexact Rounded
314nextt589 nexttoward  -1.0000E-999       -Infinity -> -1.00000001E-999
315nextt590 nexttoward  -1.00000000E-999   -Infinity -> -1.00000001E-999
316nextt591 nexttoward  -1E-999            -Infinity -> -1.00000001E-999
317nextt592 nexttoward  -9.99999998E+999   -Infinity -> -9.99999999E+999
318nextt593 nexttoward  -9.99999999E+999   -Infinity -> -Infinity Overflow Inexact Rounded
319
320
321
322
323------- Specials
324maxExponent: 384
325minexponent: -383
326nextt780 nexttoward -Inf  -Inf   -> -Infinity
327nextt781 nexttoward -Inf  -1000  -> -9.99999999E+384
328nextt782 nexttoward -Inf  -1     -> -9.99999999E+384
329nextt783 nexttoward -Inf  -0     -> -9.99999999E+384
330nextt784 nexttoward -Inf   0     -> -9.99999999E+384
331nextt785 nexttoward -Inf   1     -> -9.99999999E+384
332nextt786 nexttoward -Inf   1000  -> -9.99999999E+384
333nextt787 nexttoward -1000 -Inf   -> -1000.00001
334nextt788 nexttoward -Inf  -Inf   -> -Infinity
335nextt789 nexttoward -1    -Inf   -> -1.00000001
336nextt790 nexttoward -0    -Inf   -> -1E-391           Underflow Subnormal Inexact Rounded
337nextt791 nexttoward  0    -Inf   -> -1E-391           Underflow Subnormal Inexact Rounded
338nextt792 nexttoward  1    -Inf   ->  0.999999999
339nextt793 nexttoward  1000 -Inf   ->  999.999999
340nextt794 nexttoward  Inf  -Inf   ->  9.99999999E+384
341
342nextt800 nexttoward  Inf  -Inf   ->  9.99999999E+384
343nextt801 nexttoward  Inf  -1000  ->  9.99999999E+384
344nextt802 nexttoward  Inf  -1     ->  9.99999999E+384
345nextt803 nexttoward  Inf  -0     ->  9.99999999E+384
346nextt804 nexttoward  Inf   0     ->  9.99999999E+384
347nextt805 nexttoward  Inf   1     ->  9.99999999E+384
348nextt806 nexttoward  Inf   1000  ->  9.99999999E+384
349nextt807 nexttoward  Inf   Inf   ->  Infinity
350nextt808 nexttoward -1000  Inf   -> -999.999999
351nextt809 nexttoward -Inf   Inf   -> -9.99999999E+384
352nextt810 nexttoward -1     Inf   -> -0.999999999
353nextt811 nexttoward -0     Inf   ->  1E-391           Underflow Subnormal Inexact Rounded
354nextt812 nexttoward  0     Inf   ->  1E-391           Underflow Subnormal Inexact Rounded
355nextt813 nexttoward  1     Inf   ->  1.00000001
356nextt814 nexttoward  1000  Inf   ->  1000.00001
357nextt815 nexttoward  Inf   Inf   ->  Infinity
358
359nextt821 nexttoward  NaN -Inf    ->  NaN
360nextt822 nexttoward  NaN -1000   ->  NaN
361nextt823 nexttoward  NaN -1      ->  NaN
362nextt824 nexttoward  NaN -0      ->  NaN
363nextt825 nexttoward  NaN  0      ->  NaN
364nextt826 nexttoward  NaN  1      ->  NaN
365nextt827 nexttoward  NaN  1000   ->  NaN
366nextt828 nexttoward  NaN  Inf    ->  NaN
367nextt829 nexttoward  NaN  NaN    ->  NaN
368nextt830 nexttoward -Inf  NaN    ->  NaN
369nextt831 nexttoward -1000 NaN    ->  NaN
370nextt832 nexttoward -1    NaN    ->  NaN
371nextt833 nexttoward -0    NaN    ->  NaN
372nextt834 nexttoward  0    NaN    ->  NaN
373nextt835 nexttoward  1    NaN    ->  NaN
374nextt836 nexttoward  1000 NaN    ->  NaN
375nextt837 nexttoward  Inf  NaN    ->  NaN
376
377nextt841 nexttoward  sNaN -Inf   ->  NaN  Invalid_operation
378nextt842 nexttoward  sNaN -1000  ->  NaN  Invalid_operation
379nextt843 nexttoward  sNaN -1     ->  NaN  Invalid_operation
380nextt844 nexttoward  sNaN -0     ->  NaN  Invalid_operation
381nextt845 nexttoward  sNaN  0     ->  NaN  Invalid_operation
382nextt846 nexttoward  sNaN  1     ->  NaN  Invalid_operation
383nextt847 nexttoward  sNaN  1000  ->  NaN  Invalid_operation
384nextt848 nexttoward  sNaN  NaN   ->  NaN  Invalid_operation
385nextt849 nexttoward  sNaN sNaN   ->  NaN  Invalid_operation
386nextt850 nexttoward  NaN  sNaN   ->  NaN  Invalid_operation
387nextt851 nexttoward -Inf  sNaN   ->  NaN  Invalid_operation
388nextt852 nexttoward -1000 sNaN   ->  NaN  Invalid_operation
389nextt853 nexttoward -1    sNaN   ->  NaN  Invalid_operation
390nextt854 nexttoward -0    sNaN   ->  NaN  Invalid_operation
391nextt855 nexttoward  0    sNaN   ->  NaN  Invalid_operation
392nextt856 nexttoward  1    sNaN   ->  NaN  Invalid_operation
393nextt857 nexttoward  1000 sNaN   ->  NaN  Invalid_operation
394nextt858 nexttoward  Inf  sNaN   ->  NaN  Invalid_operation
395nextt859 nexttoward  NaN  sNaN   ->  NaN  Invalid_operation
396
397-- propagating NaNs
398nextt861 nexttoward  NaN1   -Inf    ->  NaN1
399nextt862 nexttoward +NaN2   -1000   ->  NaN2
400nextt863 nexttoward  NaN3    1000   ->  NaN3
401nextt864 nexttoward  NaN4    Inf    ->  NaN4
402nextt865 nexttoward  NaN5   +NaN6   ->  NaN5
403nextt866 nexttoward -Inf     NaN7   ->  NaN7
404nextt867 nexttoward -1000    NaN8   ->  NaN8
405nextt868 nexttoward  1000    NaN9   ->  NaN9
406nextt869 nexttoward  Inf    +NaN10  ->  NaN10
407nextt871 nexttoward  sNaN11  -Inf   ->  NaN11  Invalid_operation
408nextt872 nexttoward  sNaN12  -1000  ->  NaN12  Invalid_operation
409nextt873 nexttoward  sNaN13   1000  ->  NaN13  Invalid_operation
410nextt874 nexttoward  sNaN14   NaN17 ->  NaN14  Invalid_operation
411nextt875 nexttoward  sNaN15  sNaN18 ->  NaN15  Invalid_operation
412nextt876 nexttoward  NaN16   sNaN19 ->  NaN19  Invalid_operation
413nextt877 nexttoward -Inf    +sNaN20 ->  NaN20  Invalid_operation
414nextt878 nexttoward -1000    sNaN21 ->  NaN21  Invalid_operation
415nextt879 nexttoward  1000    sNaN22 ->  NaN22  Invalid_operation
416nextt880 nexttoward  Inf     sNaN23 ->  NaN23  Invalid_operation
417nextt881 nexttoward +NaN25  +sNaN24 ->  NaN24  Invalid_operation
418nextt882 nexttoward -NaN26    NaN28 -> -NaN26
419nextt883 nexttoward -sNaN27  sNaN29 -> -NaN27  Invalid_operation
420nextt884 nexttoward  1000    -NaN30 -> -NaN30
421nextt885 nexttoward  1000   -sNaN31 -> -NaN31  Invalid_operation
422
423-- Null tests
424nextt900 nexttoward 1  # -> NaN Invalid_operation
425nextt901 nexttoward #  1 -> NaN Invalid_operation
426
427