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