1------------------------------------------------------------------------
2-- ddCopySign.decTest -- quiet decDouble copy with sign from rhs      --
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
22-- All operands and results are decDoubles.
23precision:   16
24maxExponent: 384
25minExponent: -383
26extended:    1
27clamp:       1
28rounding:    half_even
29
30-- Sanity check
31ddcps001 copysign       +7.50     11 -> 7.50
32
33-- Infinities
34ddcps011 copysign  Infinity       11 -> Infinity
35ddcps012 copysign  -Infinity      11 -> Infinity
36
37-- NaNs, 0 payload
38ddcps021 copysign         NaN     11 -> NaN
39ddcps022 copysign        -NaN     11 -> NaN
40ddcps023 copysign        sNaN     11 -> sNaN
41ddcps024 copysign       -sNaN     11 -> sNaN
42
43-- NaNs, non-0 payload
44ddcps031 copysign       NaN10     11 -> NaN10
45ddcps032 copysign      -NaN10     11 -> NaN10
46ddcps033 copysign      sNaN10     11 -> sNaN10
47ddcps034 copysign     -sNaN10     11 -> sNaN10
48ddcps035 copysign       NaN7      11 -> NaN7
49ddcps036 copysign      -NaN7      11 -> NaN7
50ddcps037 copysign      sNaN101    11 -> sNaN101
51ddcps038 copysign     -sNaN101    11 -> sNaN101
52
53-- finites
54ddcps101 copysign          7      11 -> 7
55ddcps102 copysign         -7      11 -> 7
56ddcps103 copysign         75      11 -> 75
57ddcps104 copysign        -75      11 -> 75
58ddcps105 copysign       7.50      11 -> 7.50
59ddcps106 copysign      -7.50      11 -> 7.50
60ddcps107 copysign       7.500     11 -> 7.500
61ddcps108 copysign      -7.500     11 -> 7.500
62
63-- zeros
64ddcps111 copysign          0      11 -> 0
65ddcps112 copysign         -0      11 -> 0
66ddcps113 copysign       0E+4      11 -> 0E+4
67ddcps114 copysign      -0E+4      11 -> 0E+4
68ddcps115 copysign     0.0000      11 -> 0.0000
69ddcps116 copysign    -0.0000      11 -> 0.0000
70ddcps117 copysign      0E-141     11 -> 0E-141
71ddcps118 copysign     -0E-141     11 -> 0E-141
72
73-- full coefficients, alternating bits
74ddcps121 copysign  2682682682682682            11 -> 2682682682682682
75ddcps122 copysign  -2682682682682682           11 -> 2682682682682682
76ddcps123 copysign  1341341341341341            11 -> 1341341341341341
77ddcps124 copysign  -1341341341341341           11 -> 1341341341341341
78
79-- Nmax, Nmin, Ntiny
80ddcps131 copysign  9.999999999999999E+384      11 -> 9.999999999999999E+384
81ddcps132 copysign  1E-383                      11 -> 1E-383
82ddcps133 copysign  1.000000000000000E-383      11 -> 1.000000000000000E-383
83ddcps134 copysign  1E-398                      11 -> 1E-398
84
85ddcps135 copysign  -1E-398                     11 -> 1E-398
86ddcps136 copysign  -1.000000000000000E-383     11 -> 1.000000000000000E-383
87ddcps137 copysign  -1E-383                     11 -> 1E-383
88ddcps138 copysign  -9.999999999999999E+384     11 -> 9.999999999999999E+384
89
90-- repeat with negative RHS
91
92-- Infinities
93ddcps211 copysign  Infinity       -34 -> -Infinity
94ddcps212 copysign  -Infinity      -34 -> -Infinity
95
96-- NaNs, 0 payload
97ddcps221 copysign         NaN     -34 -> -NaN
98ddcps222 copysign        -NaN     -34 -> -NaN
99ddcps223 copysign        sNaN     -34 -> -sNaN
100ddcps224 copysign       -sNaN     -34 -> -sNaN
101
102-- NaNs, non-0 payload
103ddcps231 copysign       NaN10     -34 -> -NaN10
104ddcps232 copysign      -NaN10     -34 -> -NaN10
105ddcps233 copysign      sNaN10     -34 -> -sNaN10
106ddcps234 copysign     -sNaN10     -34 -> -sNaN10
107ddcps235 copysign       NaN7      -34 -> -NaN7
108ddcps236 copysign      -NaN7      -34 -> -NaN7
109ddcps237 copysign      sNaN101    -34 -> -sNaN101
110ddcps238 copysign     -sNaN101    -34 -> -sNaN101
111
112-- finites
113ddcps301 copysign          7      -34 -> -7
114ddcps302 copysign         -7      -34 -> -7
115ddcps303 copysign         75      -34 -> -75
116ddcps304 copysign        -75      -34 -> -75
117ddcps305 copysign       7.50      -34 -> -7.50
118ddcps306 copysign      -7.50      -34 -> -7.50
119ddcps307 copysign       7.500     -34 -> -7.500
120ddcps308 copysign      -7.500     -34 -> -7.500
121
122-- zeros
123ddcps311 copysign          0      -34 -> -0
124ddcps312 copysign         -0      -34 -> -0
125ddcps313 copysign       0E+4      -34 -> -0E+4
126ddcps314 copysign      -0E+4      -34 -> -0E+4
127ddcps315 copysign     0.0000      -34 -> -0.0000
128ddcps316 copysign    -0.0000      -34 -> -0.0000
129ddcps317 copysign      0E-141     -34 -> -0E-141
130ddcps318 copysign     -0E-141     -34 -> -0E-141
131
132-- full coefficients, alternating bits
133ddcps321 copysign  2682682682682682            -34 -> -2682682682682682
134ddcps322 copysign  -2682682682682682           -34 -> -2682682682682682
135ddcps323 copysign  1341341341341341            -34 -> -1341341341341341
136ddcps324 copysign  -1341341341341341           -34 -> -1341341341341341
137
138-- Nmax, Nmin, Ntiny
139ddcps331 copysign  9.999999999999999E+384      -34 -> -9.999999999999999E+384
140ddcps332 copysign  1E-383                      -34 -> -1E-383
141ddcps333 copysign  1.000000000000000E-383      -34 -> -1.000000000000000E-383
142ddcps334 copysign  1E-398                      -34 -> -1E-398
143
144ddcps335 copysign  -1E-398                     -34 -> -1E-398
145ddcps336 copysign  -1.000000000000000E-383     -34 -> -1.000000000000000E-383
146ddcps337 copysign  -1E-383                     -34 -> -1E-383
147ddcps338 copysign  -9.999999999999999E+384     -34 -> -9.999999999999999E+384
148
149-- Other kinds of RHS
150ddcps401 copysign          701    -34 -> -701
151ddcps402 copysign         -720    -34 -> -720
152ddcps403 copysign          701    -0  -> -701
153ddcps404 copysign         -720    -0  -> -720
154ddcps405 copysign          701    +0  ->  701
155ddcps406 copysign         -720    +0  ->  720
156ddcps407 copysign          701    +34 ->  701
157ddcps408 copysign         -720    +34 ->  720
158
159ddcps413 copysign          701    -Inf  -> -701
160ddcps414 copysign         -720    -Inf  -> -720
161ddcps415 copysign          701    +Inf  ->  701
162ddcps416 copysign         -720    +Inf  ->  720
163
164ddcps420 copysign          701    -NaN  -> -701
165ddcps421 copysign         -720    -NaN  -> -720
166ddcps422 copysign          701    +NaN  ->  701
167ddcps423 copysign         -720    +NaN  ->  720
168ddcps425 copysign         -720    +NaN8 ->  720
169
170ddcps426 copysign          701    -sNaN  -> -701
171ddcps427 copysign         -720    -sNaN  -> -720
172ddcps428 copysign          701    +sNaN  ->  701
173ddcps429 copysign         -720    +sNaN  ->  720
174ddcps430 copysign         -720    +sNaN3 ->  720
175
176