• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1------------------------------------------------------------------------
2-- dqCopySign.decTest -- quiet decQuad 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 decQuads.
23extended:    1
24clamp:       1
25precision:   34
26maxExponent: 6144
27minExponent: -6143
28rounding:    half_even
29
30-- Sanity check
31dqcps001 copysign       +7.50     11 -> 7.50
32
33-- Infinities
34dqcps011 copysign  Infinity       11 -> Infinity
35dqcps012 copysign  -Infinity      11 -> Infinity
36
37-- NaNs, 0 payload
38dqcps021 copysign         NaN     11 -> NaN
39dqcps022 copysign        -NaN     11 -> NaN
40dqcps023 copysign        sNaN     11 -> sNaN
41dqcps024 copysign       -sNaN     11 -> sNaN
42
43-- NaNs, non-0 payload
44dqcps031 copysign       NaN10     11 -> NaN10
45dqcps032 copysign      -NaN10     11 -> NaN10
46dqcps033 copysign      sNaN10     11 -> sNaN10
47dqcps034 copysign     -sNaN10     11 -> sNaN10
48dqcps035 copysign       NaN7      11 -> NaN7
49dqcps036 copysign      -NaN7      11 -> NaN7
50dqcps037 copysign      sNaN101    11 -> sNaN101
51dqcps038 copysign     -sNaN101    11 -> sNaN101
52
53-- finites
54dqcps101 copysign          7      11 -> 7
55dqcps102 copysign         -7      11 -> 7
56dqcps103 copysign         75      11 -> 75
57dqcps104 copysign        -75      11 -> 75
58dqcps105 copysign       7.50      11 -> 7.50
59dqcps106 copysign      -7.50      11 -> 7.50
60dqcps107 copysign       7.500     11 -> 7.500
61dqcps108 copysign      -7.500     11 -> 7.500
62
63-- zeros
64dqcps111 copysign          0      11 -> 0
65dqcps112 copysign         -0      11 -> 0
66dqcps113 copysign       0E+4      11 -> 0E+4
67dqcps114 copysign      -0E+4      11 -> 0E+4
68dqcps115 copysign     0.0000      11 -> 0.0000
69dqcps116 copysign    -0.0000      11 -> 0.0000
70dqcps117 copysign      0E-141     11 -> 0E-141
71dqcps118 copysign     -0E-141     11 -> 0E-141
72
73-- full coefficients, alternating bits
74dqcps121 copysign   2682682682682682682682682682682682 8  ->  2682682682682682682682682682682682
75dqcps122 copysign  -2682682682682682682682682682682682 8  ->  2682682682682682682682682682682682
76dqcps123 copysign   1341341341341341341341341341341341 8  ->  1341341341341341341341341341341341
77dqcps124 copysign  -1341341341341341341341341341341341 8  ->  1341341341341341341341341341341341
78
79-- Nmax, Nmin, Ntiny
80dqcps131 copysign  9.999999999999999999999999999999999E+6144 8 ->  9.999999999999999999999999999999999E+6144
81dqcps132 copysign  1E-6143                                   8 ->  1E-6143
82dqcps133 copysign  1.000000000000000000000000000000000E-6143 8 ->  1.000000000000000000000000000000000E-6143
83dqcps134 copysign  1E-6176                                   8 ->  1E-6176
84
85dqcps135 copysign  -1E-6176                                   8 ->  1E-6176
86dqcps136 copysign  -1.000000000000000000000000000000000E-6143 8 ->  1.000000000000000000000000000000000E-6143
87dqcps137 copysign  -1E-6143                                   8 ->  1E-6143
88dqcps138 copysign  -9.999999999999999999999999999999999E+6144 8 ->  9.999999999999999999999999999999999E+6144
89
90-- repeat with negative RHS
91
92-- Infinities
93dqcps211 copysign  Infinity       -34 -> -Infinity
94dqcps212 copysign  -Infinity      -34 -> -Infinity
95
96-- NaNs, 0 payload
97dqcps221 copysign         NaN     -34 -> -NaN
98dqcps222 copysign        -NaN     -34 -> -NaN
99dqcps223 copysign        sNaN     -34 -> -sNaN
100dqcps224 copysign       -sNaN     -34 -> -sNaN
101
102-- NaNs, non-0 payload
103dqcps231 copysign       NaN10     -34 -> -NaN10
104dqcps232 copysign      -NaN10     -34 -> -NaN10
105dqcps233 copysign      sNaN10     -34 -> -sNaN10
106dqcps234 copysign     -sNaN10     -34 -> -sNaN10
107dqcps235 copysign       NaN7      -34 -> -NaN7
108dqcps236 copysign      -NaN7      -34 -> -NaN7
109dqcps237 copysign      sNaN101    -34 -> -sNaN101
110dqcps238 copysign     -sNaN101    -34 -> -sNaN101
111
112-- finites
113dqcps301 copysign          7      -34 -> -7
114dqcps302 copysign         -7      -34 -> -7
115dqcps303 copysign         75      -34 -> -75
116dqcps304 copysign        -75      -34 -> -75
117dqcps305 copysign       7.50      -34 -> -7.50
118dqcps306 copysign      -7.50      -34 -> -7.50
119dqcps307 copysign       7.500     -34 -> -7.500
120dqcps308 copysign      -7.500     -34 -> -7.500
121
122-- zeros
123dqcps311 copysign          0      -34 -> -0
124dqcps312 copysign         -0      -34 -> -0
125dqcps313 copysign       0E+4      -34 -> -0E+4
126dqcps314 copysign      -0E+4      -34 -> -0E+4
127dqcps315 copysign     0.0000      -34 -> -0.0000
128dqcps316 copysign    -0.0000      -34 -> -0.0000
129dqcps317 copysign      0E-141     -34 -> -0E-141
130dqcps318 copysign     -0E-141     -34 -> -0E-141
131
132-- full coefficients, alternating bits
133dqcps321 copysign   2682682682682682682682682682682682 -9 -> -2682682682682682682682682682682682
134dqcps322 copysign  -2682682682682682682682682682682682 -9 -> -2682682682682682682682682682682682
135dqcps323 copysign   1341341341341341341341341341341341 -9 -> -1341341341341341341341341341341341
136dqcps324 copysign  -1341341341341341341341341341341341 -9 -> -1341341341341341341341341341341341
137
138-- Nmax, Nmin, Ntiny
139dqcps331 copysign  9.999999999999999999999999999999999E+6144 -1  -> -9.999999999999999999999999999999999E+6144
140dqcps332 copysign  1E-6143                                   -1  -> -1E-6143
141dqcps333 copysign  1.000000000000000000000000000000000E-6143 -1  -> -1.000000000000000000000000000000000E-6143
142dqcps334 copysign  1E-6176                                   -1  -> -1E-6176
143
144dqcps335 copysign  -1E-6176                                   -3 -> -1E-6176
145dqcps336 copysign  -1.000000000000000000000000000000000E-6143 -3 -> -1.000000000000000000000000000000000E-6143
146dqcps337 copysign  -1E-6143                                   -3 -> -1E-6143
147dqcps338 copysign  -9.999999999999999999999999999999999E+6144 -3 -> -9.999999999999999999999999999999999E+6144
148
149-- Other kinds of RHS
150dqcps401 copysign          701    -34 -> -701
151dqcps402 copysign         -720    -34 -> -720
152dqcps403 copysign          701    -0  -> -701
153dqcps404 copysign         -720    -0  -> -720
154dqcps405 copysign          701    +0  ->  701
155dqcps406 copysign         -720    +0  ->  720
156dqcps407 copysign          701    +34 ->  701
157dqcps408 copysign         -720    +34 ->  720
158
159dqcps413 copysign          701    -Inf  -> -701
160dqcps414 copysign         -720    -Inf  -> -720
161dqcps415 copysign          701    +Inf  ->  701
162dqcps416 copysign         -720    +Inf  ->  720
163
164dqcps420 copysign          701    -NaN  -> -701
165dqcps421 copysign         -720    -NaN  -> -720
166dqcps422 copysign          701    +NaN  ->  701
167dqcps423 copysign         -720    +NaN  ->  720
168dqcps425 copysign         -720    +NaN8 ->  720
169
170dqcps426 copysign          701    -sNaN  -> -701
171dqcps427 copysign         -720    -sNaN  -> -720
172dqcps428 copysign          701    +sNaN  ->  701
173dqcps429 copysign         -720    +sNaN  ->  720
174dqcps430 copysign         -720    +sNaN3 ->  720
175
176