ddLogB.decTest 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. ------------------------------------------------------------------------
  2. -- ddLogB.decTest -- integral 754r adjusted exponent, for decDoubles --
  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. precision: 16
  22. maxExponent: 384
  23. minExponent: -383
  24. extended: 1
  25. clamp: 1
  26. rounding: half_even
  27. -- basics
  28. ddlogb000 logb 0 -> -Infinity Division_by_zero
  29. ddlogb001 logb 1E-398 -> -398
  30. ddlogb002 logb 1E-383 -> -383
  31. ddlogb003 logb 0.001 -> -3
  32. ddlogb004 logb 0.03 -> -2
  33. ddlogb005 logb 1 -> 0
  34. ddlogb006 logb 2 -> 0
  35. ddlogb007 logb 2.5 -> 0
  36. ddlogb008 logb 2.500 -> 0
  37. ddlogb009 logb 10 -> 1
  38. ddlogb010 logb 70 -> 1
  39. ddlogb011 logb 100 -> 2
  40. ddlogb012 logb 333 -> 2
  41. ddlogb013 logb 9E+384 -> 384
  42. ddlogb014 logb +Infinity -> Infinity
  43. -- negatives appear to be treated as positives
  44. ddlogb021 logb -0 -> -Infinity Division_by_zero
  45. ddlogb022 logb -1E-398 -> -398
  46. ddlogb023 logb -9E-383 -> -383
  47. ddlogb024 logb -0.001 -> -3
  48. ddlogb025 logb -1 -> 0
  49. ddlogb026 logb -2 -> 0
  50. ddlogb027 logb -10 -> 1
  51. ddlogb028 logb -70 -> 1
  52. ddlogb029 logb -100 -> 2
  53. ddlogb030 logb -9E+384 -> 384
  54. ddlogb031 logb -Infinity -> Infinity
  55. -- zeros
  56. ddlogb111 logb 0 -> -Infinity Division_by_zero
  57. ddlogb112 logb -0 -> -Infinity Division_by_zero
  58. ddlogb113 logb 0E+4 -> -Infinity Division_by_zero
  59. ddlogb114 logb -0E+4 -> -Infinity Division_by_zero
  60. ddlogb115 logb 0.0000 -> -Infinity Division_by_zero
  61. ddlogb116 logb -0.0000 -> -Infinity Division_by_zero
  62. ddlogb117 logb 0E-141 -> -Infinity Division_by_zero
  63. ddlogb118 logb -0E-141 -> -Infinity Division_by_zero
  64. -- full coefficients, alternating bits
  65. ddlogb121 logb 268268268 -> 8
  66. ddlogb122 logb -268268268 -> 8
  67. ddlogb123 logb 134134134 -> 8
  68. ddlogb124 logb -134134134 -> 8
  69. -- Nmax, Nmin, Ntiny
  70. ddlogb131 logb 9.999999999999999E+384 -> 384
  71. ddlogb132 logb 1E-383 -> -383
  72. ddlogb133 logb 1.000000000000000E-383 -> -383
  73. ddlogb134 logb 1E-398 -> -398
  74. ddlogb135 logb -1E-398 -> -398
  75. ddlogb136 logb -1.000000000000000E-383 -> -383
  76. ddlogb137 logb -1E-383 -> -383
  77. ddlogb138 logb -9.999999999999999E+384 -> 384
  78. -- ones
  79. ddlogb0061 logb 1 -> 0
  80. ddlogb0062 logb 1.0 -> 0
  81. ddlogb0063 logb 1.000000000000000 -> 0
  82. -- notable cases -- exact powers of 10
  83. ddlogb1100 logb 1 -> 0
  84. ddlogb1101 logb 10 -> 1
  85. ddlogb1102 logb 100 -> 2
  86. ddlogb1103 logb 1000 -> 3
  87. ddlogb1104 logb 10000 -> 4
  88. ddlogb1105 logb 100000 -> 5
  89. ddlogb1106 logb 1000000 -> 6
  90. ddlogb1107 logb 10000000 -> 7
  91. ddlogb1108 logb 100000000 -> 8
  92. ddlogb1109 logb 1000000000 -> 9
  93. ddlogb1110 logb 10000000000 -> 10
  94. ddlogb1111 logb 100000000000 -> 11
  95. ddlogb1112 logb 1000000000000 -> 12
  96. ddlogb1113 logb 0.00000000001 -> -11
  97. ddlogb1114 logb 0.0000000001 -> -10
  98. ddlogb1115 logb 0.000000001 -> -9
  99. ddlogb1116 logb 0.00000001 -> -8
  100. ddlogb1117 logb 0.0000001 -> -7
  101. ddlogb1118 logb 0.000001 -> -6
  102. ddlogb1119 logb 0.00001 -> -5
  103. ddlogb1120 logb 0.0001 -> -4
  104. ddlogb1121 logb 0.001 -> -3
  105. ddlogb1122 logb 0.01 -> -2
  106. ddlogb1123 logb 0.1 -> -1
  107. ddlogb1124 logb 1E-99 -> -99
  108. ddlogb1125 logb 1E-100 -> -100
  109. ddlogb1127 logb 1E-299 -> -299
  110. ddlogb1126 logb 1E-383 -> -383
  111. -- suggestions from Ilan Nehama
  112. ddlogb1400 logb 10E-3 -> -2
  113. ddlogb1401 logb 10E-2 -> -1
  114. ddlogb1402 logb 100E-2 -> 0
  115. ddlogb1403 logb 1000E-2 -> 1
  116. ddlogb1404 logb 10000E-2 -> 2
  117. ddlogb1405 logb 10E-1 -> 0
  118. ddlogb1406 logb 100E-1 -> 1
  119. ddlogb1407 logb 1000E-1 -> 2
  120. ddlogb1408 logb 10000E-1 -> 3
  121. ddlogb1409 logb 10E0 -> 1
  122. ddlogb1410 logb 100E0 -> 2
  123. ddlogb1411 logb 1000E0 -> 3
  124. ddlogb1412 logb 10000E0 -> 4
  125. ddlogb1413 logb 10E1 -> 2
  126. ddlogb1414 logb 100E1 -> 3
  127. ddlogb1415 logb 1000E1 -> 4
  128. ddlogb1416 logb 10000E1 -> 5
  129. ddlogb1417 logb 10E2 -> 3
  130. ddlogb1418 logb 100E2 -> 4
  131. ddlogb1419 logb 1000E2 -> 5
  132. ddlogb1420 logb 10000E2 -> 6
  133. -- special values
  134. ddlogb820 logb Infinity -> Infinity
  135. ddlogb821 logb 0 -> -Infinity Division_by_zero
  136. ddlogb822 logb NaN -> NaN
  137. ddlogb823 logb sNaN -> NaN Invalid_operation
  138. -- propagating NaNs
  139. ddlogb824 logb sNaN123 -> NaN123 Invalid_operation
  140. ddlogb825 logb -sNaN321 -> -NaN321 Invalid_operation
  141. ddlogb826 logb NaN456 -> NaN456
  142. ddlogb827 logb -NaN654 -> -NaN654
  143. ddlogb828 logb NaN1 -> NaN1
  144. -- Null test
  145. ddlogb900 logb # -> NaN Invalid_operation