dqLogB.decTest 6.1 KB

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