• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1------------------------------------------------------------------------
2-- dqLogB.decTest -- integral 754r adjusted exponent, for decQuads    --
3-- Copyright (c) IBM Corporation, 2005, 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
23clamp:       1
24precision:   34
25maxExponent: 6144
26minExponent: -6143
27rounding:    half_even
28
29-- basics
30dqlogb000 logb  0                 -> -Infinity  Division_by_zero
31dqlogb001 logb  1E-6176           -> -6176
32dqlogb002 logb  1E-6143           -> -6143
33dqlogb003 logb  0.001             -> -3
34dqlogb004 logb  0.03              -> -2
35dqlogb005 logb  1                 ->  0
36dqlogb006 logb  2                 ->  0
37dqlogb007 logb  2.5               ->  0
38dqlogb008 logb  2.50              ->  0
39dqlogb009 logb  2.500             ->  0
40dqlogb010 logb  10                ->  1
41dqlogb011 logb  70                ->  1
42dqlogb012 logb  100               ->  2
43dqlogb013 logb  250               ->  2
44dqlogb014 logb  9E+6144           ->  6144
45dqlogb015 logb +Infinity          ->  Infinity
46
47-- negatives appear to be treated as positives
48dqlogb021 logb -0                 -> -Infinity  Division_by_zero
49dqlogb022 logb -1E-6176           -> -6176
50dqlogb023 logb -9E-6143           -> -6143
51dqlogb024 logb -0.001             -> -3
52dqlogb025 logb -1                 ->  0
53dqlogb026 logb -2                 ->  0
54dqlogb027 logb -10                ->  1
55dqlogb028 logb -70                ->  1
56dqlogb029 logb -100               ->  2
57dqlogb030 logb -9E+6144           ->  6144
58dqlogb031 logb -Infinity          ->  Infinity
59
60-- zeros
61dqlogb111 logb          0   -> -Infinity  Division_by_zero
62dqlogb112 logb         -0   -> -Infinity  Division_by_zero
63dqlogb113 logb       0E+4   -> -Infinity  Division_by_zero
64dqlogb114 logb      -0E+4   -> -Infinity  Division_by_zero
65dqlogb115 logb     0.0000   -> -Infinity  Division_by_zero
66dqlogb116 logb    -0.0000   -> -Infinity  Division_by_zero
67dqlogb117 logb      0E-141  -> -Infinity  Division_by_zero
68dqlogb118 logb     -0E-141  -> -Infinity  Division_by_zero
69
70-- full coefficients, alternating bits
71dqlogb121 logb   268268268        -> 8
72dqlogb122 logb  -268268268        -> 8
73dqlogb123 logb   134134134        -> 8
74dqlogb124 logb  -134134134        -> 8
75
76-- Nmax, Nmin, Ntiny
77dqlogb131 logb  9.999999999999999999999999999999999E+6144   ->  6144
78dqlogb132 logb  1E-6143                   -> -6143
79dqlogb133 logb  1.000000000000000000000000000000000E-6143   -> -6143
80dqlogb134 logb  1E-6176                   -> -6176
81
82dqlogb135 logb  -1E-6176                  -> -6176
83dqlogb136 logb  -1.000000000000000000000000000000000E-6143  -> -6143
84dqlogb137 logb  -1E-6143                  -> -6143
85dqlogb1614 logb  -9.999999999999999999999999999999999E+6144  ->  6144
86
87-- ones
88dqlogb0061 logb  1                 ->   0
89dqlogb0062 logb  1.0               ->   0
90dqlogb0063 logb  1.000000000000000 ->   0
91
92-- notable cases -- exact powers of 10
93dqlogb1100 logb 1             -> 0
94dqlogb1101 logb 10            -> 1
95dqlogb1102 logb 100           -> 2
96dqlogb1103 logb 1000          -> 3
97dqlogb1104 logb 10000         -> 4
98dqlogb1105 logb 100000        -> 5
99dqlogb1106 logb 1000000       -> 6
100dqlogb1107 logb 10000000      -> 7
101dqlogb1108 logb 100000000     -> 8
102dqlogb1109 logb 1000000000    -> 9
103dqlogb1110 logb 10000000000   -> 10
104dqlogb1111 logb 100000000000  -> 11
105dqlogb1112 logb 1000000000000 -> 12
106dqlogb1113 logb 0.00000000001 -> -11
107dqlogb1114 logb 0.0000000001 -> -10
108dqlogb1115 logb 0.000000001 -> -9
109dqlogb1116 logb 0.00000001 -> -8
110dqlogb1117 logb 0.0000001 -> -7
111dqlogb1118 logb 0.000001 -> -6
112dqlogb1119 logb 0.00001 -> -5
113dqlogb1120 logb 0.0001 -> -4
114dqlogb1121 logb 0.001 -> -3
115dqlogb1122 logb 0.01 -> -2
116dqlogb1123 logb 0.1 -> -1
117dqlogb1124 logb 1E-99  -> -99
118dqlogb1125 logb 1E-100 -> -100
119dqlogb1127 logb 1E-299 -> -299
120dqlogb1126 logb 1E-6143 -> -6143
121
122-- suggestions from Ilan Nehama
123dqlogb1400 logb 10E-3    -> -2
124dqlogb1401 logb 10E-2    -> -1
125dqlogb1402 logb 100E-2   ->  0
126dqlogb1403 logb 1000E-2  ->  1
127dqlogb1404 logb 10000E-2 ->  2
128dqlogb1405 logb 10E-1    ->  0
129dqlogb1406 logb 100E-1   ->  1
130dqlogb1407 logb 1000E-1  ->  2
131dqlogb1408 logb 10000E-1 ->  3
132dqlogb1409 logb 10E0     ->  1
133dqlogb1410 logb 100E0    ->  2
134dqlogb1411 logb 1000E0   ->  3
135dqlogb1412 logb 10000E0  ->  4
136dqlogb1413 logb 10E1     ->  2
137dqlogb1414 logb 100E1    ->  3
138dqlogb1415 logb 1000E1   ->  4
139dqlogb1416 logb 10000E1  ->  5
140dqlogb1417 logb 10E2     ->  3
141dqlogb1418 logb 100E2    ->  4
142dqlogb1419 logb 1000E2   ->  5
143dqlogb1420 logb 10000E2  ->  6
144
145-- special values
146dqlogb820  logb   Infinity ->   Infinity
147dqlogb821  logb   0        ->  -Infinity Division_by_zero
148dqlogb822  logb   NaN      ->   NaN
149dqlogb823  logb   sNaN     ->   NaN     Invalid_operation
150-- propagating NaNs
151dqlogb824  logb   sNaN123  ->   NaN123  Invalid_operation
152dqlogb825  logb   -sNaN321 ->  -NaN321  Invalid_operation
153dqlogb826  logb   NaN456   ->   NaN456
154dqlogb827  logb   -NaN654  ->  -NaN654
155dqlogb828  logb   NaN1     ->   NaN1
156
157-- Null test
158dqlogb900  logb #   -> NaN Invalid_operation
159
160
161