PageRenderTime 57ms CodeModel.GetById 20ms RepoModel.GetById 0ms app.codeStats 0ms

/Lib/test/decimaltestdata/base.decTest

http://unladen-swallow.googlecode.com/
Unknown | 1411 lines | 1324 code | 87 blank | 0 comment | 0 complexity | 10f9be742cbdcefef24ca79c90684b4b MD5 | raw file
Possible License(s): 0BSD, BSD-3-Clause
  1. ------------------------------------------------------------------------
  2. -- base.decTest -- base decimal <--> string conversions --
  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. ------------------------------------------------------------------------
  20. version: 2.58
  21. extended: 1
  22. -- This file tests base conversions from string to a decimal number
  23. -- and back to a string (in either Scientific or Engineering form)
  24. -- Note that unlike other operations the operand is subject to rounding
  25. -- to conform to emax and precision settings (that is, numbers will
  26. -- conform to rules and exponent will be in permitted range).
  27. precision: 16
  28. rounding: half_up
  29. maxExponent: 384
  30. minExponent: -383
  31. basx001 toSci 0 -> 0
  32. basx002 toSci 1 -> 1
  33. basx003 toSci 1.0 -> 1.0
  34. basx004 toSci 1.00 -> 1.00
  35. basx005 toSci 10 -> 10
  36. basx006 toSci 1000 -> 1000
  37. basx007 toSci 10.0 -> 10.0
  38. basx008 toSci 10.1 -> 10.1
  39. basx009 toSci 10.4 -> 10.4
  40. basx010 toSci 10.5 -> 10.5
  41. basx011 toSci 10.6 -> 10.6
  42. basx012 toSci 10.9 -> 10.9
  43. basx013 toSci 11.0 -> 11.0
  44. basx014 toSci 1.234 -> 1.234
  45. basx015 toSci 0.123 -> 0.123
  46. basx016 toSci 0.012 -> 0.012
  47. basx017 toSci -0 -> -0
  48. basx018 toSci -0.0 -> -0.0
  49. basx019 toSci -00.00 -> -0.00
  50. basx021 toSci -1 -> -1
  51. basx022 toSci -1.0 -> -1.0
  52. basx023 toSci -0.1 -> -0.1
  53. basx024 toSci -9.1 -> -9.1
  54. basx025 toSci -9.11 -> -9.11
  55. basx026 toSci -9.119 -> -9.119
  56. basx027 toSci -9.999 -> -9.999
  57. basx030 toSci '123456789.123456' -> '123456789.123456'
  58. basx031 toSci '123456789.000000' -> '123456789.000000'
  59. basx032 toSci '123456789123456' -> '123456789123456'
  60. basx033 toSci '0.0000123456789' -> '0.0000123456789'
  61. basx034 toSci '0.00000123456789' -> '0.00000123456789'
  62. basx035 toSci '0.000000123456789' -> '1.23456789E-7'
  63. basx036 toSci '0.0000000123456789' -> '1.23456789E-8'
  64. basx037 toSci '0.123456789012344' -> '0.123456789012344'
  65. basx038 toSci '0.123456789012345' -> '0.123456789012345'
  66. -- String [many more examples are implicitly tested elsewhere]
  67. -- strings without E cannot generate E in result
  68. basx040 toSci "12" -> '12'
  69. basx041 toSci "-76" -> '-76'
  70. basx042 toSci "12.76" -> '12.76'
  71. basx043 toSci "+12.76" -> '12.76'
  72. basx044 toSci "012.76" -> '12.76'
  73. basx045 toSci "+0.003" -> '0.003'
  74. basx046 toSci "17." -> '17'
  75. basx047 toSci ".5" -> '0.5'
  76. basx048 toSci "044" -> '44'
  77. basx049 toSci "0044" -> '44'
  78. basx050 toSci "0.0005" -> '0.0005'
  79. basx051 toSci "00.00005" -> '0.00005'
  80. basx052 toSci "0.000005" -> '0.000005'
  81. basx053 toSci "0.0000050" -> '0.0000050'
  82. basx054 toSci "0.0000005" -> '5E-7'
  83. basx055 toSci "0.00000005" -> '5E-8'
  84. basx056 toSci "12345678.543210" -> '12345678.543210'
  85. basx057 toSci "2345678.543210" -> '2345678.543210'
  86. basx058 toSci "345678.543210" -> '345678.543210'
  87. basx059 toSci "0345678.54321" -> '345678.54321'
  88. basx060 toSci "345678.5432" -> '345678.5432'
  89. basx061 toSci "+345678.5432" -> '345678.5432'
  90. basx062 toSci "+0345678.5432" -> '345678.5432'
  91. basx063 toSci "+00345678.5432" -> '345678.5432'
  92. basx064 toSci "-345678.5432" -> '-345678.5432'
  93. basx065 toSci "-0345678.5432" -> '-345678.5432'
  94. basx066 toSci "-00345678.5432" -> '-345678.5432'
  95. -- examples
  96. basx067 toSci "5E-6" -> '0.000005'
  97. basx068 toSci "50E-7" -> '0.0000050'
  98. basx069 toSci "5E-7" -> '5E-7'
  99. -- [No exotics as no Unicode]
  100. -- rounded with dots in all (including edge) places
  101. basx071 toSci .1234567890123456123 -> 0.1234567890123456 Inexact Rounded
  102. basx072 toSci 1.234567890123456123 -> 1.234567890123456 Inexact Rounded
  103. basx073 toSci 12.34567890123456123 -> 12.34567890123456 Inexact Rounded
  104. basx074 toSci 123.4567890123456123 -> 123.4567890123456 Inexact Rounded
  105. basx075 toSci 1234.567890123456123 -> 1234.567890123456 Inexact Rounded
  106. basx076 toSci 12345.67890123456123 -> 12345.67890123456 Inexact Rounded
  107. basx077 toSci 123456.7890123456123 -> 123456.7890123456 Inexact Rounded
  108. basx078 toSci 1234567.890123456123 -> 1234567.890123456 Inexact Rounded
  109. basx079 toSci 12345678.90123456123 -> 12345678.90123456 Inexact Rounded
  110. basx080 toSci 123456789.0123456123 -> 123456789.0123456 Inexact Rounded
  111. basx081 toSci 1234567890.123456123 -> 1234567890.123456 Inexact Rounded
  112. basx082 toSci 12345678901.23456123 -> 12345678901.23456 Inexact Rounded
  113. basx083 toSci 123456789012.3456123 -> 123456789012.3456 Inexact Rounded
  114. basx084 toSci 1234567890123.456123 -> 1234567890123.456 Inexact Rounded
  115. basx085 toSci 12345678901234.56123 -> 12345678901234.56 Inexact Rounded
  116. basx086 toSci 123456789012345.6123 -> 123456789012345.6 Inexact Rounded
  117. basx087 toSci 1234567890123456.123 -> 1234567890123456 Inexact Rounded
  118. basx088 toSci 12345678901234561.23 -> 1.234567890123456E+16 Inexact Rounded
  119. basx089 toSci 123456789012345612.3 -> 1.234567890123456E+17 Inexact Rounded
  120. basx090 toSci 1234567890123456123. -> 1.234567890123456E+18 Inexact Rounded
  121. -- Numbers with E
  122. basx130 toSci "0.000E-1" -> '0.0000'
  123. basx131 toSci "0.000E-2" -> '0.00000'
  124. basx132 toSci "0.000E-3" -> '0.000000'
  125. basx133 toSci "0.000E-4" -> '0E-7'
  126. basx134 toSci "0.00E-2" -> '0.0000'
  127. basx135 toSci "0.00E-3" -> '0.00000'
  128. basx136 toSci "0.00E-4" -> '0.000000'
  129. basx137 toSci "0.00E-5" -> '0E-7'
  130. basx138 toSci "+0E+9" -> '0E+9'
  131. basx139 toSci "-0E+9" -> '-0E+9'
  132. basx140 toSci "1E+9" -> '1E+9'
  133. basx141 toSci "1e+09" -> '1E+9'
  134. basx142 toSci "1E+90" -> '1E+90'
  135. basx143 toSci "+1E+009" -> '1E+9'
  136. basx144 toSci "0E+9" -> '0E+9'
  137. basx145 toSci "1E+9" -> '1E+9'
  138. basx146 toSci "1E+09" -> '1E+9'
  139. basx147 toSci "1e+90" -> '1E+90'
  140. basx148 toSci "1E+009" -> '1E+9'
  141. basx149 toSci "000E+9" -> '0E+9'
  142. basx150 toSci "1E9" -> '1E+9'
  143. basx151 toSci "1e09" -> '1E+9'
  144. basx152 toSci "1E90" -> '1E+90'
  145. basx153 toSci "1E009" -> '1E+9'
  146. basx154 toSci "0E9" -> '0E+9'
  147. basx155 toSci "0.000e+0" -> '0.000'
  148. basx156 toSci "0.000E-1" -> '0.0000'
  149. basx157 toSci "4E+9" -> '4E+9'
  150. basx158 toSci "44E+9" -> '4.4E+10'
  151. basx159 toSci "0.73e-7" -> '7.3E-8'
  152. basx160 toSci "00E+9" -> '0E+9'
  153. basx161 toSci "00E-9" -> '0E-9'
  154. basx162 toSci "10E+9" -> '1.0E+10'
  155. basx163 toSci "10E+09" -> '1.0E+10'
  156. basx164 toSci "10e+90" -> '1.0E+91'
  157. basx165 toSci "10E+009" -> '1.0E+10'
  158. basx166 toSci "100e+9" -> '1.00E+11'
  159. basx167 toSci "100e+09" -> '1.00E+11'
  160. basx168 toSci "100E+90" -> '1.00E+92'
  161. basx169 toSci "100e+009" -> '1.00E+11'
  162. basx170 toSci "1.265" -> '1.265'
  163. basx171 toSci "1.265E-20" -> '1.265E-20'
  164. basx172 toSci "1.265E-8" -> '1.265E-8'
  165. basx173 toSci "1.265E-4" -> '0.0001265'
  166. basx174 toSci "1.265E-3" -> '0.001265'
  167. basx175 toSci "1.265E-2" -> '0.01265'
  168. basx176 toSci "1.265E-1" -> '0.1265'
  169. basx177 toSci "1.265E-0" -> '1.265'
  170. basx178 toSci "1.265E+1" -> '12.65'
  171. basx179 toSci "1.265E+2" -> '126.5'
  172. basx180 toSci "1.265E+3" -> '1265'
  173. basx181 toSci "1.265E+4" -> '1.265E+4'
  174. basx182 toSci "1.265E+8" -> '1.265E+8'
  175. basx183 toSci "1.265E+20" -> '1.265E+20'
  176. basx190 toSci "12.65" -> '12.65'
  177. basx191 toSci "12.65E-20" -> '1.265E-19'
  178. basx192 toSci "12.65E-8" -> '1.265E-7'
  179. basx193 toSci "12.65E-4" -> '0.001265'
  180. basx194 toSci "12.65E-3" -> '0.01265'
  181. basx195 toSci "12.65E-2" -> '0.1265'
  182. basx196 toSci "12.65E-1" -> '1.265'
  183. basx197 toSci "12.65E-0" -> '12.65'
  184. basx198 toSci "12.65E+1" -> '126.5'
  185. basx199 toSci "12.65E+2" -> '1265'
  186. basx200 toSci "12.65E+3" -> '1.265E+4'
  187. basx201 toSci "12.65E+4" -> '1.265E+5'
  188. basx202 toSci "12.65E+8" -> '1.265E+9'
  189. basx203 toSci "12.65E+20" -> '1.265E+21'
  190. basx210 toSci "126.5" -> '126.5'
  191. basx211 toSci "126.5E-20" -> '1.265E-18'
  192. basx212 toSci "126.5E-8" -> '0.000001265'
  193. basx213 toSci "126.5E-4" -> '0.01265'
  194. basx214 toSci "126.5E-3" -> '0.1265'
  195. basx215 toSci "126.5E-2" -> '1.265'
  196. basx216 toSci "126.5E-1" -> '12.65'
  197. basx217 toSci "126.5E-0" -> '126.5'
  198. basx218 toSci "126.5E+1" -> '1265'
  199. basx219 toSci "126.5E+2" -> '1.265E+4'
  200. basx220 toSci "126.5E+3" -> '1.265E+5'
  201. basx221 toSci "126.5E+4" -> '1.265E+6'
  202. basx222 toSci "126.5E+8" -> '1.265E+10'
  203. basx223 toSci "126.5E+20" -> '1.265E+22'
  204. basx230 toSci "1265" -> '1265'
  205. basx231 toSci "1265E-20" -> '1.265E-17'
  206. basx232 toSci "1265E-8" -> '0.00001265'
  207. basx233 toSci "1265E-4" -> '0.1265'
  208. basx234 toSci "1265E-3" -> '1.265'
  209. basx235 toSci "1265E-2" -> '12.65'
  210. basx236 toSci "1265E-1" -> '126.5'
  211. basx237 toSci "1265E-0" -> '1265'
  212. basx238 toSci "1265E+1" -> '1.265E+4'
  213. basx239 toSci "1265E+2" -> '1.265E+5'
  214. basx240 toSci "1265E+3" -> '1.265E+6'
  215. basx241 toSci "1265E+4" -> '1.265E+7'
  216. basx242 toSci "1265E+8" -> '1.265E+11'
  217. basx243 toSci "1265E+20" -> '1.265E+23'
  218. basx250 toSci "0.1265" -> '0.1265'
  219. basx251 toSci "0.1265E-20" -> '1.265E-21'
  220. basx252 toSci "0.1265E-8" -> '1.265E-9'
  221. basx253 toSci "0.1265E-4" -> '0.00001265'
  222. basx254 toSci "0.1265E-3" -> '0.0001265'
  223. basx255 toSci "0.1265E-2" -> '0.001265'
  224. basx256 toSci "0.1265E-1" -> '0.01265'
  225. basx257 toSci "0.1265E-0" -> '0.1265'
  226. basx258 toSci "0.1265E+1" -> '1.265'
  227. basx259 toSci "0.1265E+2" -> '12.65'
  228. basx260 toSci "0.1265E+3" -> '126.5'
  229. basx261 toSci "0.1265E+4" -> '1265'
  230. basx262 toSci "0.1265E+8" -> '1.265E+7'
  231. basx263 toSci "0.1265E+20" -> '1.265E+19'
  232. -- some more negative zeros [systematic tests below]
  233. basx290 toSci "-0.000E-1" -> '-0.0000'
  234. basx291 toSci "-0.000E-2" -> '-0.00000'
  235. basx292 toSci "-0.000E-3" -> '-0.000000'
  236. basx293 toSci "-0.000E-4" -> '-0E-7'
  237. basx294 toSci "-0.00E-2" -> '-0.0000'
  238. basx295 toSci "-0.00E-3" -> '-0.00000'
  239. basx296 toSci "-0.0E-2" -> '-0.000'
  240. basx297 toSci "-0.0E-3" -> '-0.0000'
  241. basx298 toSci "-0E-2" -> '-0.00'
  242. basx299 toSci "-0E-3" -> '-0.000'
  243. -- Engineering notation tests
  244. basx301 toSci 10e12 -> 1.0E+13
  245. basx302 toEng 10e12 -> 10E+12
  246. basx303 toSci 10e11 -> 1.0E+12
  247. basx304 toEng 10e11 -> 1.0E+12
  248. basx305 toSci 10e10 -> 1.0E+11
  249. basx306 toEng 10e10 -> 100E+9
  250. basx307 toSci 10e9 -> 1.0E+10
  251. basx308 toEng 10e9 -> 10E+9
  252. basx309 toSci 10e8 -> 1.0E+9
  253. basx310 toEng 10e8 -> 1.0E+9
  254. basx311 toSci 10e7 -> 1.0E+8
  255. basx312 toEng 10e7 -> 100E+6
  256. basx313 toSci 10e6 -> 1.0E+7
  257. basx314 toEng 10e6 -> 10E+6
  258. basx315 toSci 10e5 -> 1.0E+6
  259. basx316 toEng 10e5 -> 1.0E+6
  260. basx317 toSci 10e4 -> 1.0E+5
  261. basx318 toEng 10e4 -> 100E+3
  262. basx319 toSci 10e3 -> 1.0E+4
  263. basx320 toEng 10e3 -> 10E+3
  264. basx321 toSci 10e2 -> 1.0E+3
  265. basx322 toEng 10e2 -> 1.0E+3
  266. basx323 toSci 10e1 -> 1.0E+2
  267. basx324 toEng 10e1 -> 100
  268. basx325 toSci 10e0 -> 10
  269. basx326 toEng 10e0 -> 10
  270. basx327 toSci 10e-1 -> 1.0
  271. basx328 toEng 10e-1 -> 1.0
  272. basx329 toSci 10e-2 -> 0.10
  273. basx330 toEng 10e-2 -> 0.10
  274. basx331 toSci 10e-3 -> 0.010
  275. basx332 toEng 10e-3 -> 0.010
  276. basx333 toSci 10e-4 -> 0.0010
  277. basx334 toEng 10e-4 -> 0.0010
  278. basx335 toSci 10e-5 -> 0.00010
  279. basx336 toEng 10e-5 -> 0.00010
  280. basx337 toSci 10e-6 -> 0.000010
  281. basx338 toEng 10e-6 -> 0.000010
  282. basx339 toSci 10e-7 -> 0.0000010
  283. basx340 toEng 10e-7 -> 0.0000010
  284. basx341 toSci 10e-8 -> 1.0E-7
  285. basx342 toEng 10e-8 -> 100E-9
  286. basx343 toSci 10e-9 -> 1.0E-8
  287. basx344 toEng 10e-9 -> 10E-9
  288. basx345 toSci 10e-10 -> 1.0E-9
  289. basx346 toEng 10e-10 -> 1.0E-9
  290. basx347 toSci 10e-11 -> 1.0E-10
  291. basx348 toEng 10e-11 -> 100E-12
  292. basx349 toSci 10e-12 -> 1.0E-11
  293. basx350 toEng 10e-12 -> 10E-12
  294. basx351 toSci 10e-13 -> 1.0E-12
  295. basx352 toEng 10e-13 -> 1.0E-12
  296. basx361 toSci 7E12 -> 7E+12
  297. basx362 toEng 7E12 -> 7E+12
  298. basx363 toSci 7E11 -> 7E+11
  299. basx364 toEng 7E11 -> 700E+9
  300. basx365 toSci 7E10 -> 7E+10
  301. basx366 toEng 7E10 -> 70E+9
  302. basx367 toSci 7E9 -> 7E+9
  303. basx368 toEng 7E9 -> 7E+9
  304. basx369 toSci 7E8 -> 7E+8
  305. basx370 toEng 7E8 -> 700E+6
  306. basx371 toSci 7E7 -> 7E+7
  307. basx372 toEng 7E7 -> 70E+6
  308. basx373 toSci 7E6 -> 7E+6
  309. basx374 toEng 7E6 -> 7E+6
  310. basx375 toSci 7E5 -> 7E+5
  311. basx376 toEng 7E5 -> 700E+3
  312. basx377 toSci 7E4 -> 7E+4
  313. basx378 toEng 7E4 -> 70E+3
  314. basx379 toSci 7E3 -> 7E+3
  315. basx380 toEng 7E3 -> 7E+3
  316. basx381 toSci 7E2 -> 7E+2
  317. basx382 toEng 7E2 -> 700
  318. basx383 toSci 7E1 -> 7E+1
  319. basx384 toEng 7E1 -> 70
  320. basx385 toSci 7E0 -> 7
  321. basx386 toEng 7E0 -> 7
  322. basx387 toSci 7E-1 -> 0.7
  323. basx388 toEng 7E-1 -> 0.7
  324. basx389 toSci 7E-2 -> 0.07
  325. basx390 toEng 7E-2 -> 0.07
  326. basx391 toSci 7E-3 -> 0.007
  327. basx392 toEng 7E-3 -> 0.007
  328. basx393 toSci 7E-4 -> 0.0007
  329. basx394 toEng 7E-4 -> 0.0007
  330. basx395 toSci 7E-5 -> 0.00007
  331. basx396 toEng 7E-5 -> 0.00007
  332. basx397 toSci 7E-6 -> 0.000007
  333. basx398 toEng 7E-6 -> 0.000007
  334. basx399 toSci 7E-7 -> 7E-7
  335. basx400 toEng 7E-7 -> 700E-9
  336. basx401 toSci 7E-8 -> 7E-8
  337. basx402 toEng 7E-8 -> 70E-9
  338. basx403 toSci 7E-9 -> 7E-9
  339. basx404 toEng 7E-9 -> 7E-9
  340. basx405 toSci 7E-10 -> 7E-10
  341. basx406 toEng 7E-10 -> 700E-12
  342. basx407 toSci 7E-11 -> 7E-11
  343. basx408 toEng 7E-11 -> 70E-12
  344. basx409 toSci 7E-12 -> 7E-12
  345. basx410 toEng 7E-12 -> 7E-12
  346. basx411 toSci 7E-13 -> 7E-13
  347. basx412 toEng 7E-13 -> 700E-15
  348. -- Exacts remain exact up to precision ..
  349. precision: 9
  350. basx420 toSci 100 -> 100
  351. basx421 toEng 100 -> 100
  352. basx422 toSci 1000 -> 1000
  353. basx423 toEng 1000 -> 1000
  354. basx424 toSci 999.9 -> 999.9
  355. basx425 toEng 999.9 -> 999.9
  356. basx426 toSci 1000.0 -> 1000.0
  357. basx427 toEng 1000.0 -> 1000.0
  358. basx428 toSci 1000.1 -> 1000.1
  359. basx429 toEng 1000.1 -> 1000.1
  360. basx430 toSci 10000 -> 10000
  361. basx431 toEng 10000 -> 10000
  362. basx432 toSci 100000 -> 100000
  363. basx433 toEng 100000 -> 100000
  364. basx434 toSci 1000000 -> 1000000
  365. basx435 toEng 1000000 -> 1000000
  366. basx436 toSci 10000000 -> 10000000
  367. basx437 toEng 10000000 -> 10000000
  368. basx438 toSci 100000000 -> 100000000
  369. basx439 toEng 100000000 -> 100000000
  370. basx440 toSci 1000000000 -> 1.00000000E+9 Rounded
  371. basx441 toEng 1000000000 -> 1.00000000E+9 Rounded
  372. basx442 toSci 1000000000 -> 1.00000000E+9 Rounded
  373. basx443 toEng 1000000000 -> 1.00000000E+9 Rounded
  374. basx444 toSci 1000000003 -> 1.00000000E+9 Rounded Inexact
  375. basx445 toEng 1000000003 -> 1.00000000E+9 Rounded Inexact
  376. basx446 toSci 1000000005 -> 1.00000001E+9 Rounded Inexact
  377. basx447 toEng 1000000005 -> 1.00000001E+9 Rounded Inexact
  378. basx448 toSci 10000000050 -> 1.00000001E+10 Rounded Inexact
  379. basx449 toEng 10000000050 -> 10.0000001E+9 Rounded Inexact
  380. basx450 toSci 1000000009 -> 1.00000001E+9 Rounded Inexact
  381. basx451 toEng 1000000009 -> 1.00000001E+9 Rounded Inexact
  382. basx452 toSci 10000000000 -> 1.00000000E+10 Rounded
  383. basx453 toEng 10000000000 -> 10.0000000E+9 Rounded
  384. basx454 toSci 10000000003 -> 1.00000000E+10 Rounded Inexact
  385. basx455 toEng 10000000003 -> 10.0000000E+9 Rounded Inexact
  386. basx456 toSci 10000000005 -> 1.00000000E+10 Rounded Inexact
  387. basx457 toEng 10000000005 -> 10.0000000E+9 Rounded Inexact
  388. basx458 toSci 10000000009 -> 1.00000000E+10 Rounded Inexact
  389. basx459 toEng 10000000009 -> 10.0000000E+9 Rounded Inexact
  390. basx460 toSci 100000000000 -> 1.00000000E+11 Rounded
  391. basx461 toEng 100000000000 -> 100.000000E+9 Rounded
  392. basx462 toSci 100000000300 -> 1.00000000E+11 Rounded Inexact
  393. basx463 toEng 100000000300 -> 100.000000E+9 Rounded Inexact
  394. basx464 toSci 100000000500 -> 1.00000001E+11 Rounded Inexact
  395. basx465 toEng 100000000500 -> 100.000001E+9 Rounded Inexact
  396. basx466 toSci 100000000900 -> 1.00000001E+11 Rounded Inexact
  397. basx467 toEng 100000000900 -> 100.000001E+9 Rounded Inexact
  398. basx468 toSci 1000000000000 -> 1.00000000E+12 Rounded
  399. basx469 toEng 1000000000000 -> 1.00000000E+12 Rounded
  400. basx470 toSci 1000000003000 -> 1.00000000E+12 Rounded Inexact
  401. basx471 toEng 1000000003000 -> 1.00000000E+12 Rounded Inexact
  402. basx472 toSci 1000000005000 -> 1.00000001E+12 Rounded Inexact
  403. basx473 toEng 1000000005000 -> 1.00000001E+12 Rounded Inexact
  404. basx474 toSci 1000000009000 -> 1.00000001E+12 Rounded Inexact
  405. basx475 toEng 1000000009000 -> 1.00000001E+12 Rounded Inexact
  406. -- all-nines rounding
  407. precision: 9
  408. rounding: half_up
  409. basx270 toSci 999999999 -> 999999999
  410. basx271 toSci 9999999990 -> 9.99999999E+9 Rounded
  411. basx272 toSci 9999999991 -> 9.99999999E+9 Rounded Inexact
  412. basx273 toSci 9999999992 -> 9.99999999E+9 Rounded Inexact
  413. basx274 toSci 9999999993 -> 9.99999999E+9 Rounded Inexact
  414. basx275 toSci 9999999994 -> 9.99999999E+9 Rounded Inexact
  415. basx276 toSci 9999999995 -> 1.00000000E+10 Rounded Inexact
  416. basx277 toSci 9999999996 -> 1.00000000E+10 Rounded Inexact
  417. basx278 toSci 9999999997 -> 1.00000000E+10 Rounded Inexact
  418. basx279 toSci 9999999998 -> 1.00000000E+10 Rounded Inexact
  419. basx280 toSci 9999999999 -> 1.00000000E+10 Rounded Inexact
  420. basx281 toSci 9999999999999999 -> 1.00000000E+16 Rounded Inexact
  421. -- check rounding modes heeded
  422. precision: 5
  423. rounding: ceiling
  424. bsrx401 toSci 1.23450 -> 1.2345 Rounded
  425. bsrx402 toSci 1.234549 -> 1.2346 Rounded Inexact
  426. bsrx403 toSci 1.234550 -> 1.2346 Rounded Inexact
  427. bsrx404 toSci 1.234551 -> 1.2346 Rounded Inexact
  428. rounding: up
  429. bsrx405 toSci 1.23450 -> 1.2345 Rounded
  430. bsrx406 toSci 1.234549 -> 1.2346 Rounded Inexact
  431. bsrx407 toSci 1.234550 -> 1.2346 Rounded Inexact
  432. bsrx408 toSci 1.234551 -> 1.2346 Rounded Inexact
  433. rounding: floor
  434. bsrx410 toSci 1.23450 -> 1.2345 Rounded
  435. bsrx411 toSci 1.234549 -> 1.2345 Rounded Inexact
  436. bsrx412 toSci 1.234550 -> 1.2345 Rounded Inexact
  437. bsrx413 toSci 1.234551 -> 1.2345 Rounded Inexact
  438. rounding: half_down
  439. bsrx415 toSci 1.23450 -> 1.2345 Rounded
  440. bsrx416 toSci 1.234549 -> 1.2345 Rounded Inexact
  441. bsrx417 toSci 1.234550 -> 1.2345 Rounded Inexact
  442. bsrx418 toSci 1.234650 -> 1.2346 Rounded Inexact
  443. bsrx419 toSci 1.234551 -> 1.2346 Rounded Inexact
  444. rounding: half_even
  445. bsrx421 toSci 1.23450 -> 1.2345 Rounded
  446. bsrx422 toSci 1.234549 -> 1.2345 Rounded Inexact
  447. bsrx423 toSci 1.234550 -> 1.2346 Rounded Inexact
  448. bsrx424 toSci 1.234650 -> 1.2346 Rounded Inexact
  449. bsrx425 toSci 1.234551 -> 1.2346 Rounded Inexact
  450. rounding: down
  451. bsrx426 toSci 1.23450 -> 1.2345 Rounded
  452. bsrx427 toSci 1.234549 -> 1.2345 Rounded Inexact
  453. bsrx428 toSci 1.234550 -> 1.2345 Rounded Inexact
  454. bsrx429 toSci 1.234551 -> 1.2345 Rounded Inexact
  455. rounding: half_up
  456. bsrx431 toSci 1.23450 -> 1.2345 Rounded
  457. bsrx432 toSci 1.234549 -> 1.2345 Rounded Inexact
  458. bsrx433 toSci 1.234550 -> 1.2346 Rounded Inexact
  459. bsrx434 toSci 1.234650 -> 1.2347 Rounded Inexact
  460. bsrx435 toSci 1.234551 -> 1.2346 Rounded Inexact
  461. -- negatives
  462. rounding: ceiling
  463. bsrx501 toSci -1.23450 -> -1.2345 Rounded
  464. bsrx502 toSci -1.234549 -> -1.2345 Rounded Inexact
  465. bsrx503 toSci -1.234550 -> -1.2345 Rounded Inexact
  466. bsrx504 toSci -1.234551 -> -1.2345 Rounded Inexact
  467. rounding: up
  468. bsrx505 toSci -1.23450 -> -1.2345 Rounded
  469. bsrx506 toSci -1.234549 -> -1.2346 Rounded Inexact
  470. bsrx507 toSci -1.234550 -> -1.2346 Rounded Inexact
  471. bsrx508 toSci -1.234551 -> -1.2346 Rounded Inexact
  472. rounding: floor
  473. bsrx510 toSci -1.23450 -> -1.2345 Rounded
  474. bsrx511 toSci -1.234549 -> -1.2346 Rounded Inexact
  475. bsrx512 toSci -1.234550 -> -1.2346 Rounded Inexact
  476. bsrx513 toSci -1.234551 -> -1.2346 Rounded Inexact
  477. rounding: half_down
  478. bsrx515 toSci -1.23450 -> -1.2345 Rounded
  479. bsrx516 toSci -1.234549 -> -1.2345 Rounded Inexact
  480. bsrx517 toSci -1.234550 -> -1.2345 Rounded Inexact
  481. bsrx518 toSci -1.234650 -> -1.2346 Rounded Inexact
  482. bsrx519 toSci -1.234551 -> -1.2346 Rounded Inexact
  483. rounding: half_even
  484. bsrx521 toSci -1.23450 -> -1.2345 Rounded
  485. bsrx522 toSci -1.234549 -> -1.2345 Rounded Inexact
  486. bsrx523 toSci -1.234550 -> -1.2346 Rounded Inexact
  487. bsrx524 toSci -1.234650 -> -1.2346 Rounded Inexact
  488. bsrx525 toSci -1.234551 -> -1.2346 Rounded Inexact
  489. rounding: down
  490. bsrx526 toSci -1.23450 -> -1.2345 Rounded
  491. bsrx527 toSci -1.234549 -> -1.2345 Rounded Inexact
  492. bsrx528 toSci -1.234550 -> -1.2345 Rounded Inexact
  493. bsrx529 toSci -1.234551 -> -1.2345 Rounded Inexact
  494. rounding: half_up
  495. bsrx531 toSci -1.23450 -> -1.2345 Rounded
  496. bsrx532 toSci -1.234549 -> -1.2345 Rounded Inexact
  497. bsrx533 toSci -1.234550 -> -1.2346 Rounded Inexact
  498. bsrx534 toSci -1.234650 -> -1.2347 Rounded Inexact
  499. bsrx535 toSci -1.234551 -> -1.2346 Rounded Inexact
  500. -- a few larger exponents
  501. maxExponent: 999999999
  502. minExponent: -999999999
  503. basx480 toSci "0.09e999" -> '9E+997'
  504. basx481 toSci "0.9e999" -> '9E+998'
  505. basx482 toSci "9e999" -> '9E+999'
  506. basx483 toSci "9.9e999" -> '9.9E+999'
  507. basx484 toSci "9.99e999" -> '9.99E+999'
  508. basx485 toSci "9.99e-999" -> '9.99E-999'
  509. basx486 toSci "9.9e-999" -> '9.9E-999'
  510. basx487 toSci "9e-999" -> '9E-999'
  511. basx489 toSci "99e-999" -> '9.9E-998'
  512. basx490 toSci "999e-999" -> '9.99E-997'
  513. basx491 toSci '0.9e-998' -> '9E-999'
  514. basx492 toSci '0.09e-997' -> '9E-999'
  515. basx493 toSci '0.1e1000' -> '1E+999'
  516. basx494 toSci '10e-1000' -> '1.0E-999'
  517. rounding: half_up
  518. precision: 9
  519. -- The 'baddies' tests from DiagBigDecimal, plus some new ones
  520. basx500 toSci '1..2' -> NaN Conversion_syntax
  521. basx501 toSci '.' -> NaN Conversion_syntax
  522. basx502 toSci '..' -> NaN Conversion_syntax
  523. basx503 toSci '++1' -> NaN Conversion_syntax
  524. basx504 toSci '--1' -> NaN Conversion_syntax
  525. basx505 toSci '-+1' -> NaN Conversion_syntax
  526. basx506 toSci '+-1' -> NaN Conversion_syntax
  527. basx507 toSci '12e' -> NaN Conversion_syntax
  528. basx508 toSci '12e++' -> NaN Conversion_syntax
  529. basx509 toSci '12f4' -> NaN Conversion_syntax
  530. basx510 toSci ' +1' -> NaN Conversion_syntax
  531. basx511 toSci '+ 1' -> NaN Conversion_syntax
  532. basx512 toSci '12 ' -> NaN Conversion_syntax
  533. basx513 toSci ' + 1' -> NaN Conversion_syntax
  534. basx514 toSci ' - 1 ' -> NaN Conversion_syntax
  535. basx515 toSci 'x' -> NaN Conversion_syntax
  536. basx516 toSci '-1-' -> NaN Conversion_syntax
  537. basx517 toSci '12-' -> NaN Conversion_syntax
  538. basx518 toSci '3+' -> NaN Conversion_syntax
  539. basx519 toSci '' -> NaN Conversion_syntax
  540. basx520 toSci '1e-' -> NaN Conversion_syntax
  541. basx521 toSci '7e99999a' -> NaN Conversion_syntax
  542. basx522 toSci '7e123567890x' -> NaN Conversion_syntax
  543. basx523 toSci '7e12356789012x' -> NaN Conversion_syntax
  544. basx524 toSci '' -> NaN Conversion_syntax
  545. basx525 toSci 'e100' -> NaN Conversion_syntax
  546. basx526 toSci '\u0e5a' -> NaN Conversion_syntax
  547. basx527 toSci '\u0b65' -> NaN Conversion_syntax
  548. basx528 toSci '123,65' -> NaN Conversion_syntax
  549. basx529 toSci '1.34.5' -> NaN Conversion_syntax
  550. basx530 toSci '.123.5' -> NaN Conversion_syntax
  551. basx531 toSci '01.35.' -> NaN Conversion_syntax
  552. basx532 toSci '01.35-' -> NaN Conversion_syntax
  553. basx533 toSci '0000..' -> NaN Conversion_syntax
  554. basx534 toSci '.0000.' -> NaN Conversion_syntax
  555. basx535 toSci '00..00' -> NaN Conversion_syntax
  556. basx536 toSci '111e*123' -> NaN Conversion_syntax
  557. basx537 toSci '111e123-' -> NaN Conversion_syntax
  558. basx538 toSci '111e+12+' -> NaN Conversion_syntax
  559. basx539 toSci '111e1-3-' -> NaN Conversion_syntax
  560. basx540 toSci '111e1*23' -> NaN Conversion_syntax
  561. basx541 toSci '111e1e+3' -> NaN Conversion_syntax
  562. basx542 toSci '1e1.0' -> NaN Conversion_syntax
  563. basx543 toSci '1e123e' -> NaN Conversion_syntax
  564. basx544 toSci 'ten' -> NaN Conversion_syntax
  565. basx545 toSci 'ONE' -> NaN Conversion_syntax
  566. basx546 toSci '1e.1' -> NaN Conversion_syntax
  567. basx547 toSci '1e1.' -> NaN Conversion_syntax
  568. basx548 toSci '1ee' -> NaN Conversion_syntax
  569. basx549 toSci 'e+1' -> NaN Conversion_syntax
  570. basx550 toSci '1.23.4' -> NaN Conversion_syntax
  571. basx551 toSci '1.2.1' -> NaN Conversion_syntax
  572. basx552 toSci '1E+1.2' -> NaN Conversion_syntax
  573. basx553 toSci '1E+1.2.3' -> NaN Conversion_syntax
  574. basx554 toSci '1E++1' -> NaN Conversion_syntax
  575. basx555 toSci '1E--1' -> NaN Conversion_syntax
  576. basx556 toSci '1E+-1' -> NaN Conversion_syntax
  577. basx557 toSci '1E-+1' -> NaN Conversion_syntax
  578. basx558 toSci '1E''1' -> NaN Conversion_syntax
  579. basx559 toSci "1E""1" -> NaN Conversion_syntax
  580. basx560 toSci "1E""""" -> NaN Conversion_syntax
  581. -- Near-specials
  582. basx561 toSci "qNaN" -> NaN Conversion_syntax
  583. basx562 toSci "NaNq" -> NaN Conversion_syntax
  584. basx563 toSci "NaNs" -> NaN Conversion_syntax
  585. basx564 toSci "Infi" -> NaN Conversion_syntax
  586. basx565 toSci "Infin" -> NaN Conversion_syntax
  587. basx566 toSci "Infini" -> NaN Conversion_syntax
  588. basx567 toSci "Infinit" -> NaN Conversion_syntax
  589. basx568 toSci "-Infinit" -> NaN Conversion_syntax
  590. basx569 toSci "0Inf" -> NaN Conversion_syntax
  591. basx570 toSci "9Inf" -> NaN Conversion_syntax
  592. basx571 toSci "-0Inf" -> NaN Conversion_syntax
  593. basx572 toSci "-9Inf" -> NaN Conversion_syntax
  594. basx573 toSci "-sNa" -> NaN Conversion_syntax
  595. basx574 toSci "xNaN" -> NaN Conversion_syntax
  596. basx575 toSci "0sNaN" -> NaN Conversion_syntax
  597. -- some baddies with dots and Es and dots and specials
  598. basx576 toSci 'e+1' -> NaN Conversion_syntax
  599. basx577 toSci '.e+1' -> NaN Conversion_syntax
  600. basx578 toSci '+.e+1' -> NaN Conversion_syntax
  601. basx579 toSci '-.e+' -> NaN Conversion_syntax
  602. basx580 toSci '-.e' -> NaN Conversion_syntax
  603. basx581 toSci 'E+1' -> NaN Conversion_syntax
  604. basx582 toSci '.E+1' -> NaN Conversion_syntax
  605. basx583 toSci '+.E+1' -> NaN Conversion_syntax
  606. basx584 toSci '-.E+' -> NaN Conversion_syntax
  607. basx585 toSci '-.E' -> NaN Conversion_syntax
  608. basx586 toSci '.NaN' -> NaN Conversion_syntax
  609. basx587 toSci '-.NaN' -> NaN Conversion_syntax
  610. basx588 toSci '+.sNaN' -> NaN Conversion_syntax
  611. basx589 toSci '+.Inf' -> NaN Conversion_syntax
  612. basx590 toSci '.Infinity' -> NaN Conversion_syntax
  613. -- Zeros
  614. basx601 toSci 0.000000000 -> 0E-9
  615. basx602 toSci 0.00000000 -> 0E-8
  616. basx603 toSci 0.0000000 -> 0E-7
  617. basx604 toSci 0.000000 -> 0.000000
  618. basx605 toSci 0.00000 -> 0.00000
  619. basx606 toSci 0.0000 -> 0.0000
  620. basx607 toSci 0.000 -> 0.000
  621. basx608 toSci 0.00 -> 0.00
  622. basx609 toSci 0.0 -> 0.0
  623. basx610 toSci .0 -> 0.0
  624. basx611 toSci 0. -> 0
  625. basx612 toSci -.0 -> -0.0
  626. basx613 toSci -0. -> -0
  627. basx614 toSci -0.0 -> -0.0
  628. basx615 toSci -0.00 -> -0.00
  629. basx616 toSci -0.000 -> -0.000
  630. basx617 toSci -0.0000 -> -0.0000
  631. basx618 toSci -0.00000 -> -0.00000
  632. basx619 toSci -0.000000 -> -0.000000
  633. basx620 toSci -0.0000000 -> -0E-7
  634. basx621 toSci -0.00000000 -> -0E-8
  635. basx622 toSci -0.000000000 -> -0E-9
  636. basx630 toSci 0.00E+0 -> 0.00
  637. basx631 toSci 0.00E+1 -> 0.0
  638. basx632 toSci 0.00E+2 -> 0
  639. basx633 toSci 0.00E+3 -> 0E+1
  640. basx634 toSci 0.00E+4 -> 0E+2
  641. basx635 toSci 0.00E+5 -> 0E+3
  642. basx636 toSci 0.00E+6 -> 0E+4
  643. basx637 toSci 0.00E+7 -> 0E+5
  644. basx638 toSci 0.00E+8 -> 0E+6
  645. basx639 toSci 0.00E+9 -> 0E+7
  646. basx640 toSci 0.0E+0 -> 0.0
  647. basx641 toSci 0.0E+1 -> 0
  648. basx642 toSci 0.0E+2 -> 0E+1
  649. basx643 toSci 0.0E+3 -> 0E+2
  650. basx644 toSci 0.0E+4 -> 0E+3
  651. basx645 toSci 0.0E+5 -> 0E+4
  652. basx646 toSci 0.0E+6 -> 0E+5
  653. basx647 toSci 0.0E+7 -> 0E+6
  654. basx648 toSci 0.0E+8 -> 0E+7
  655. basx649 toSci 0.0E+9 -> 0E+8
  656. basx650 toSci 0E+0 -> 0
  657. basx651 toSci 0E+1 -> 0E+1
  658. basx652 toSci 0E+2 -> 0E+2
  659. basx653 toSci 0E+3 -> 0E+3
  660. basx654 toSci 0E+4 -> 0E+4
  661. basx655 toSci 0E+5 -> 0E+5
  662. basx656 toSci 0E+6 -> 0E+6
  663. basx657 toSci 0E+7 -> 0E+7
  664. basx658 toSci 0E+8 -> 0E+8
  665. basx659 toSci 0E+9 -> 0E+9
  666. basx660 toSci 0.0E-0 -> 0.0
  667. basx661 toSci 0.0E-1 -> 0.00
  668. basx662 toSci 0.0E-2 -> 0.000
  669. basx663 toSci 0.0E-3 -> 0.0000
  670. basx664 toSci 0.0E-4 -> 0.00000
  671. basx665 toSci 0.0E-5 -> 0.000000
  672. basx666 toSci 0.0E-6 -> 0E-7
  673. basx667 toSci 0.0E-7 -> 0E-8
  674. basx668 toSci 0.0E-8 -> 0E-9
  675. basx669 toSci 0.0E-9 -> 0E-10
  676. basx670 toSci 0.00E-0 -> 0.00
  677. basx671 toSci 0.00E-1 -> 0.000
  678. basx672 toSci 0.00E-2 -> 0.0000
  679. basx673 toSci 0.00E-3 -> 0.00000
  680. basx674 toSci 0.00E-4 -> 0.000000
  681. basx675 toSci 0.00E-5 -> 0E-7
  682. basx676 toSci 0.00E-6 -> 0E-8
  683. basx677 toSci 0.00E-7 -> 0E-9
  684. basx678 toSci 0.00E-8 -> 0E-10
  685. basx679 toSci 0.00E-9 -> 0E-11
  686. basx680 toSci 000000. -> 0
  687. basx681 toSci 00000. -> 0
  688. basx682 toSci 0000. -> 0
  689. basx683 toSci 000. -> 0
  690. basx684 toSci 00. -> 0
  691. basx685 toSci 0. -> 0
  692. basx686 toSci +00000. -> 0
  693. basx687 toSci -00000. -> -0
  694. basx688 toSci +0. -> 0
  695. basx689 toSci -0. -> -0
  696. -- Specials
  697. precision: 4
  698. basx700 toSci "NaN" -> NaN
  699. basx701 toSci "nan" -> NaN
  700. basx702 toSci "nAn" -> NaN
  701. basx703 toSci "NAN" -> NaN
  702. basx704 toSci "+NaN" -> NaN
  703. basx705 toSci "+nan" -> NaN
  704. basx706 toSci "+nAn" -> NaN
  705. basx707 toSci "+NAN" -> NaN
  706. basx708 toSci "-NaN" -> -NaN
  707. basx709 toSci "-nan" -> -NaN
  708. basx710 toSci "-nAn" -> -NaN
  709. basx711 toSci "-NAN" -> -NaN
  710. basx712 toSci 'NaN0' -> NaN
  711. basx713 toSci 'NaN1' -> NaN1
  712. basx714 toSci 'NaN12' -> NaN12
  713. basx715 toSci 'NaN123' -> NaN123
  714. basx716 toSci 'NaN1234' -> NaN1234
  715. basx717 toSci 'NaN01' -> NaN1
  716. basx718 toSci 'NaN012' -> NaN12
  717. basx719 toSci 'NaN0123' -> NaN123
  718. basx720 toSci 'NaN01234' -> NaN1234
  719. basx721 toSci 'NaN001' -> NaN1
  720. basx722 toSci 'NaN0012' -> NaN12
  721. basx723 toSci 'NaN00123' -> NaN123
  722. basx724 toSci 'NaN001234' -> NaN1234
  723. basx725 toSci 'NaN12345' -> NaN Conversion_syntax
  724. basx726 toSci 'NaN123e+1' -> NaN Conversion_syntax
  725. basx727 toSci 'NaN12.45' -> NaN Conversion_syntax
  726. basx728 toSci 'NaN-12' -> NaN Conversion_syntax
  727. basx729 toSci 'NaN+12' -> NaN Conversion_syntax
  728. basx730 toSci "sNaN" -> sNaN
  729. basx731 toSci "snan" -> sNaN
  730. basx732 toSci "SnAn" -> sNaN
  731. basx733 toSci "SNAN" -> sNaN
  732. basx734 toSci "+sNaN" -> sNaN
  733. basx735 toSci "+snan" -> sNaN
  734. basx736 toSci "+SnAn" -> sNaN
  735. basx737 toSci "+SNAN" -> sNaN
  736. basx738 toSci "-sNaN" -> -sNaN
  737. basx739 toSci "-snan" -> -sNaN
  738. basx740 toSci "-SnAn" -> -sNaN
  739. basx741 toSci "-SNAN" -> -sNaN
  740. basx742 toSci 'sNaN0000' -> sNaN
  741. basx743 toSci 'sNaN7' -> sNaN7
  742. basx744 toSci 'sNaN007234' -> sNaN7234
  743. basx745 toSci 'sNaN72345' -> NaN Conversion_syntax
  744. basx746 toSci 'sNaN72.45' -> NaN Conversion_syntax
  745. basx747 toSci 'sNaN-72' -> NaN Conversion_syntax
  746. basx748 toSci "Inf" -> Infinity
  747. basx749 toSci "inf" -> Infinity
  748. basx750 toSci "iNf" -> Infinity
  749. basx751 toSci "INF" -> Infinity
  750. basx752 toSci "+Inf" -> Infinity
  751. basx753 toSci "+inf" -> Infinity
  752. basx754 toSci "+iNf" -> Infinity
  753. basx755 toSci "+INF" -> Infinity
  754. basx756 toSci "-Inf" -> -Infinity
  755. basx757 toSci "-inf" -> -Infinity
  756. basx758 toSci "-iNf" -> -Infinity
  757. basx759 toSci "-INF" -> -Infinity
  758. basx760 toSci "Infinity" -> Infinity
  759. basx761 toSci "infinity" -> Infinity
  760. basx762 toSci "iNfInItY" -> Infinity
  761. basx763 toSci "INFINITY" -> Infinity
  762. basx764 toSci "+Infinity" -> Infinity
  763. basx765 toSci "+infinity" -> Infinity
  764. basx766 toSci "+iNfInItY" -> Infinity
  765. basx767 toSci "+INFINITY" -> Infinity
  766. basx768 toSci "-Infinity" -> -Infinity
  767. basx769 toSci "-infinity" -> -Infinity
  768. basx770 toSci "-iNfInItY" -> -Infinity
  769. basx771 toSci "-INFINITY" -> -Infinity
  770. -- Specials and zeros for toEng
  771. basx772 toEng "NaN" -> NaN
  772. basx773 toEng "-Infinity" -> -Infinity
  773. basx774 toEng "-sNaN" -> -sNaN
  774. basx775 toEng "-NaN" -> -NaN
  775. basx776 toEng "+Infinity" -> Infinity
  776. basx778 toEng "+sNaN" -> sNaN
  777. basx779 toEng "+NaN" -> NaN
  778. basx780 toEng "INFINITY" -> Infinity
  779. basx781 toEng "SNAN" -> sNaN
  780. basx782 toEng "NAN" -> NaN
  781. basx783 toEng "infinity" -> Infinity
  782. basx784 toEng "snan" -> sNaN
  783. basx785 toEng "nan" -> NaN
  784. basx786 toEng "InFINITY" -> Infinity
  785. basx787 toEng "SnAN" -> sNaN
  786. basx788 toEng "nAN" -> NaN
  787. basx789 toEng "iNfinity" -> Infinity
  788. basx790 toEng "sNan" -> sNaN
  789. basx791 toEng "Nan" -> NaN
  790. basx792 toEng "Infinity" -> Infinity
  791. basx793 toEng "sNaN" -> sNaN
  792. -- Zero toEng, etc.
  793. basx800 toEng 0e+1 -> "0.00E+3" -- doc example
  794. basx801 toEng 0.000000000 -> 0E-9
  795. basx802 toEng 0.00000000 -> 0.00E-6
  796. basx803 toEng 0.0000000 -> 0.0E-6
  797. basx804 toEng 0.000000 -> 0.000000
  798. basx805 toEng 0.00000 -> 0.00000
  799. basx806 toEng 0.0000 -> 0.0000
  800. basx807 toEng 0.000 -> 0.000
  801. basx808 toEng 0.00 -> 0.00
  802. basx809 toEng 0.0 -> 0.0
  803. basx810 toEng .0 -> 0.0
  804. basx811 toEng 0. -> 0
  805. basx812 toEng -.0 -> -0.0
  806. basx813 toEng -0. -> -0
  807. basx814 toEng -0.0 -> -0.0
  808. basx815 toEng -0.00 -> -0.00
  809. basx816 toEng -0.000 -> -0.000
  810. basx817 toEng -0.0000 -> -0.0000
  811. basx818 toEng -0.00000 -> -0.00000
  812. basx819 toEng -0.000000 -> -0.000000
  813. basx820 toEng -0.0000000 -> -0.0E-6
  814. basx821 toEng -0.00000000 -> -0.00E-6
  815. basx822 toEng -0.000000000 -> -0E-9
  816. basx830 toEng 0.00E+0 -> 0.00
  817. basx831 toEng 0.00E+1 -> 0.0
  818. basx832 toEng 0.00E+2 -> 0
  819. basx833 toEng 0.00E+3 -> 0.00E+3
  820. basx834 toEng 0.00E+4 -> 0.0E+3
  821. basx835 toEng 0.00E+5 -> 0E+3
  822. basx836 toEng 0.00E+6 -> 0.00E+6
  823. basx837 toEng 0.00E+7 -> 0.0E+6
  824. basx838 toEng 0.00E+8 -> 0E+6
  825. basx839 toEng 0.00E+9 -> 0.00E+9
  826. basx840 toEng 0.0E+0 -> 0.0
  827. basx841 toEng 0.0E+1 -> 0
  828. basx842 toEng 0.0E+2 -> 0.00E+3
  829. basx843 toEng 0.0E+3 -> 0.0E+3
  830. basx844 toEng 0.0E+4 -> 0E+3
  831. basx845 toEng 0.0E+5 -> 0.00E+6
  832. basx846 toEng 0.0E+6 -> 0.0E+6
  833. basx847 toEng 0.0E+7 -> 0E+6
  834. basx848 toEng 0.0E+8 -> 0.00E+9
  835. basx849 toEng 0.0E+9 -> 0.0E+9
  836. basx850 toEng 0E+0 -> 0
  837. basx851 toEng 0E+1 -> 0.00E+3
  838. basx852 toEng 0E+2 -> 0.0E+3
  839. basx853 toEng 0E+3 -> 0E+3
  840. basx854 toEng 0E+4 -> 0.00E+6
  841. basx855 toEng 0E+5 -> 0.0E+6
  842. basx856 toEng 0E+6 -> 0E+6
  843. basx857 toEng 0E+7 -> 0.00E+9
  844. basx858 toEng 0E+8 -> 0.0E+9
  845. basx859 toEng 0E+9 -> 0E+9
  846. basx860 toEng 0.0E-0 -> 0.0
  847. basx861 toEng 0.0E-1 -> 0.00
  848. basx862 toEng 0.0E-2 -> 0.000
  849. basx863 toEng 0.0E-3 -> 0.0000
  850. basx864 toEng 0.0E-4 -> 0.00000
  851. basx865 toEng 0.0E-5 -> 0.000000
  852. basx866 toEng 0.0E-6 -> 0.0E-6
  853. basx867 toEng 0.0E-7 -> 0.00E-6
  854. basx868 toEng 0.0E-8 -> 0E-9
  855. basx869 toEng 0.0E-9 -> 0.0E-9
  856. basx870 toEng 0.00E-0 -> 0.00
  857. basx871 toEng 0.00E-1 -> 0.000
  858. basx872 toEng 0.00E-2 -> 0.0000
  859. basx873 toEng 0.00E-3 -> 0.00000
  860. basx874 toEng 0.00E-4 -> 0.000000
  861. basx875 toEng 0.00E-5 -> 0.0E-6
  862. basx876 toEng 0.00E-6 -> 0.00E-6
  863. basx877 toEng 0.00E-7 -> 0E-9
  864. basx878 toEng 0.00E-8 -> 0.0E-9
  865. basx879 toEng 0.00E-9 -> 0.00E-9
  866. rounding: half_up
  867. precision: 9
  868. -- subnormals and overflows
  869. basx906 toSci '99e999999999' -> Infinity Overflow Inexact Rounded
  870. basx907 toSci '999e999999999' -> Infinity Overflow Inexact Rounded
  871. basx908 toSci '0.9e-999999999' -> 9E-1000000000 Subnormal
  872. basx909 toSci '0.09e-999999999' -> 9E-1000000001 Subnormal
  873. basx910 toSci '0.1e1000000000' -> 1E+999999999
  874. basx911 toSci '10e-1000000000' -> 1.0E-999999999
  875. basx912 toSci '0.9e9999999999' -> Infinity Overflow Inexact Rounded
  876. basx913 toSci '99e-9999999999' -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped
  877. basx914 toSci '111e9999999999' -> Infinity Overflow Inexact Rounded
  878. basx915 toSci '1111e-9999999999' -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped
  879. basx916 toSci '1111e-99999999999' -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped
  880. basx917 toSci '7e1000000000' -> Infinity Overflow Inexact Rounded
  881. -- negatives the same
  882. basx918 toSci '-99e999999999' -> -Infinity Overflow Inexact Rounded
  883. basx919 toSci '-999e999999999' -> -Infinity Overflow Inexact Rounded
  884. basx920 toSci '-0.9e-999999999' -> -9E-1000000000 Subnormal
  885. basx921 toSci '-0.09e-999999999' -> -9E-1000000001 Subnormal
  886. basx922 toSci '-0.1e1000000000' -> -1E+999999999
  887. basx923 toSci '-10e-1000000000' -> -1.0E-999999999
  888. basx924 toSci '-0.9e9999999999' -> -Infinity Overflow Inexact Rounded
  889. basx925 toSci '-99e-9999999999' -> -0E-1000000007 Underflow Subnormal Inexact Rounded Clamped
  890. basx926 toSci '-111e9999999999' -> -Infinity Overflow Inexact Rounded
  891. basx927 toSci '-1111e-9999999999' -> -0E-1000000007 Underflow Subnormal Inexact Rounded Clamped
  892. basx928 toSci '-1111e-99999999999' -> -0E-1000000007 Underflow Subnormal Inexact Rounded Clamped
  893. basx929 toSci '-7e1000000000' -> -Infinity Overflow Inexact Rounded
  894. rounding: ceiling
  895. basx930 toSci '7e1000000000' -> Infinity Overflow Inexact Rounded
  896. basx931 toSci '-7e1000000000' -> -9.99999999E+999999999 Overflow Inexact Rounded
  897. rounding: up
  898. basx932 toSci '7e1000000000' -> Infinity Overflow Inexact Rounded
  899. basx933 toSci '-7e1000000000' -> -Infinity Overflow Inexact Rounded
  900. rounding: down
  901. basx934 toSci '7e1000000000' -> 9.99999999E+999999999 Overflow Inexact Rounded
  902. basx935 toSci '-7e1000000000' -> -9.99999999E+999999999 Overflow Inexact Rounded
  903. rounding: floor
  904. basx936 toSci '7e1000000000' -> 9.99999999E+999999999 Overflow Inexact Rounded
  905. basx937 toSci '-7e1000000000' -> -Infinity Overflow Inexact Rounded
  906. rounding: half_up
  907. basx938 toSci '7e1000000000' -> Infinity Overflow Inexact Rounded
  908. basx939 toSci '-7e1000000000' -> -Infinity Overflow Inexact Rounded
  909. rounding: half_even
  910. basx940 toSci '7e1000000000' -> Infinity Overflow Inexact Rounded
  911. basx941 toSci '-7e1000000000' -> -Infinity Overflow Inexact Rounded
  912. rounding: half_down
  913. basx942 toSci '7e1000000000' -> Infinity Overflow Inexact Rounded
  914. basx943 toSci '-7e1000000000' -> -Infinity Overflow Inexact Rounded
  915. rounding: half_even
  916. -- Giga exponent initial tests
  917. maxExponent: 999999999
  918. minExponent: -999999999
  919. basx951 toSci '99e999' -> '9.9E+1000'
  920. basx952 toSci '999e999' -> '9.99E+1001'
  921. basx953 toSci '0.9e-999' -> '9E-1000'
  922. basx954 toSci '0.09e-999' -> '9E-1001'
  923. basx955 toSci '0.1e1001' -> '1E+1000'
  924. basx956 toSci '10e-1001' -> '1.0E-1000'
  925. basx957 toSci '0.9e9999' -> '9E+9998'
  926. basx958 toSci '99e-9999' -> '9.9E-9998'
  927. basx959 toSci '111e9997' -> '1.11E+9999'
  928. basx960 toSci '1111e-9999' -> '1.111E-9996'
  929. basx961 toSci '99e9999' -> '9.9E+10000'
  930. basx962 toSci '999e9999' -> '9.99E+10001'
  931. basx963 toSci '0.9e-9999' -> '9E-10000'
  932. basx964 toSci '0.09e-9999' -> '9E-10001'
  933. basx965 toSci '0.1e10001' -> '1E+10000'
  934. basx966 toSci '10e-10001' -> '1.0E-10000'
  935. basx967 toSci '0.9e99999' -> '9E+99998'
  936. basx968 toSci '99e-99999' -> '9.9E-99998'
  937. basx969 toSci '111e99999' -> '1.11E+100001'
  938. basx970 toSci '1111e-99999' -> '1.111E-99996'
  939. basx971 toSci "0.09e999999999" -> '9E+999999997'
  940. basx972 toSci "0.9e999999999" -> '9E+999999998'
  941. basx973 toSci "9e999999999" -> '9E+999999999'
  942. basx974 toSci "9.9e999999999" -> '9.9E+999999999'
  943. basx975 toSci "9.99e999999999" -> '9.99E+999999999'
  944. basx976 toSci "9.99e-999999999" -> '9.99E-999999999'
  945. basx977 toSci "9.9e-999999999" -> '9.9E-999999999'
  946. basx978 toSci "9e-999999999" -> '9E-999999999'
  947. basx979 toSci "99e-999999999" -> '9.9E-999999998'
  948. basx980 toSci "999e-999999999" -> '9.99E-999999997'
  949. -- Varying exponent maximums
  950. precision: 5
  951. maxexponent: 0
  952. minexponent: 0
  953. emax001 toSci -1E+2 -> -Infinity Overflow Inexact Rounded
  954. emax002 toSci -100 -> -Infinity Overflow Inexact Rounded
  955. emax003 toSci -10 -> -Infinity Overflow Inexact Rounded
  956. emax004 toSci -9.9 -> -9.9
  957. emax005 toSci -9 -> -9
  958. emax006 toSci -1 -> -1
  959. emax007 toSci 0 -> 0
  960. emax008 toSci 1 -> 1
  961. emax009 toSci 9 -> 9
  962. emax010 toSci 9.9 -> 9.9
  963. emax011 toSci 10 -> Infinity Overflow Inexact Rounded
  964. emax012 toSci 100 -> Infinity Overflow Inexact Rounded
  965. emax013 toSci 1E+2 -> Infinity Overflow Inexact Rounded
  966. emax014 toSci 0.99 -> 0.99 Subnormal
  967. emax015 toSci 0.1 -> 0.1 Subnormal
  968. emax016 toSci 0.01 -> 0.01 Subnormal
  969. emax017 toSci 1E-1 -> 0.1 Subnormal
  970. emax018 toSci 1E-2 -> 0.01 Subnormal
  971. maxexponent: 1
  972. minexponent: -1
  973. emax100 toSci -1E+3 -> -Infinity Overflow Inexact Rounded
  974. emax101 toSci -1E+2 -> -Infinity Overflow Inexact Rounded
  975. emax102 toSci -100 -> -Infinity Overflow Inexact Rounded
  976. emax103 toSci -10 -> -10
  977. emax104 toSci -9.9 -> -9.9
  978. emax105 toSci -9 -> -9
  979. emax106 toSci -1 -> -1
  980. emax107 toSci 0 -> 0
  981. emax108 toSci 1 -> 1
  982. emax109 toSci 9 -> 9
  983. emax110 toSci 9.9 -> 9.9
  984. emax111 toSci 10 -> 10
  985. emax112 toSci 100 -> Infinity Overflow Inexact Rounded
  986. emax113 toSci 1E+2 -> Infinity Overflow Inexact Rounded
  987. emax114 toSci 1E+3 -> Infinity Overflow Inexact Rounded
  988. emax115 toSci 0.99 -> 0.99
  989. emax116 toSci 0.1 -> 0.1
  990. emax117 toSci 0.01 -> 0.01 Subnormal
  991. emax118 toSci 1E-1 -> 0.1
  992. emax119 toSci 1E-2 -> 0.01 Subnormal
  993. emax120 toSci 1E-3 -> 0.001 Subnormal
  994. emax121 toSci 1.1E-3 -> 0.0011 Subnormal
  995. emax122 toSci 1.11E-3 -> 0.00111 Subnormal
  996. emax123 toSci 1.111E-3 -> 0.00111 Subnormal Underflow Inexact Rounded
  997. emax124 toSci 1.1111E-3 -> 0.00111 Subnormal Underflow Inexact Rounded
  998. emax125 toSci 1.11111E-3 -> 0.00111 Subnormal Underflow Inexact Rounded
  999. maxexponent: 2
  1000. minexponent: -2
  1001. precision: 9
  1002. emax200 toSci -1E+3 -> -Infinity Overflow Inexact Rounded
  1003. emax201 toSci -1E+2 -> -1E+2
  1004. emax202 toSci -100 -> -100
  1005. emax203 toSci -10 -> -10
  1006. emax204 toSci -9.9 -> -9.9
  1007. emax205 toSci -9 -> -9
  1008. emax206 toSci -1 -> -1
  1009. emax207 toSci 0 -> 0
  1010. emax208 toSci 1 -> 1
  1011. emax209 toSci 9 -> 9
  1012. emax210 toSci 9.9 -> 9.9
  1013. emax211 toSci 10 -> 10
  1014. emax212 toSci 100 -> 100
  1015. emax213 toSci 1E+2 -> 1E+2
  1016. emax214 toSci 1E+3 -> Infinity Overflow Inexact Rounded
  1017. emax215 toSci 0.99 -> 0.99
  1018. emax216 toSci 0.1 -> 0.1
  1019. emax217 toSci 0.01 -> 0.01
  1020. emax218 toSci 0.001 -> 0.001 Subnormal
  1021. emax219 toSci 1E-1 -> 0.1
  1022. emax220 toSci 1E-2 -> 0.01
  1023. emax221 toSci 1E-3 -> 0.001 Subnormal
  1024. emax222 toSci 1E-4 -> 0.0001 Subnormal
  1025. emax223 toSci 1E-5 -> 0.00001 Subnormal
  1026. emax224 toSci 1E-6 -> 0.000001 Subnormal
  1027. emax225 toSci 1E-7 -> 1E-7 Subnormal
  1028. emax226 toSci 1E-8 -> 1E-8 Subnormal
  1029. emax227 toSci 1E-9 -> 1E-9 Subnormal
  1030. emax228 toSci 1E-10 -> 1E-10 Subnormal
  1031. emax229 toSci 1E-11 -> 0E-10 Underflow Subnormal Inexact Rounded Clamped
  1032. emax230 toSci 1E-12 -> 0E-10 Underflow Subnormal Inexact Rounded Clamped
  1033. maxexponent: 7
  1034. minexponent: -7
  1035. emax231 toSci 1E-8 -> 1E-8 Subnormal
  1036. emax232 toSci 1E-7 -> 1E-7
  1037. emax233 toSci 1E-6 -> 0.000001
  1038. emax234 toSci 1E-5 -> 0.00001
  1039. emax235 toSci 1E+5 -> 1E+5
  1040. emax236 toSci 1E+6 -> 1E+6
  1041. emax237 toSci 1E+7 -> 1E+7
  1042. emax238 toSci 1E+8 -> Infinity Overflow Inexact Rounded
  1043. maxexponent: 9
  1044. minexponent: -9
  1045. emax240 toSci 1E-21 -> 0E-17 Subnormal Underflow Inexact Rounded Clamped
  1046. emax241 toSci 1E-10 -> 1E-10 Subnormal
  1047. emax242 toSci 1E-9 -> 1E-9
  1048. emax243 toSci 1E-8 -> 1E-8
  1049. emax244 toSci 1E-7 -> 1E-7
  1050. emax245 toSci 1E+7 -> 1E+7
  1051. emax246 toSci 1E+8 -> 1E+8
  1052. emax247 toSci 1E+9 -> 1E+9
  1053. emax248 toSci 1E+10 -> Infinity Overflow Inexact Rounded
  1054. maxexponent: 10 -- boundary
  1055. minexponent: -10
  1056. emax250 toSci 1E-21 -> 0E-18 Underflow Subnormal Inexact Rounded Clamped
  1057. emax251 toSci 1E-11 -> 1E-11 Subnormal
  1058. emax252 toSci 1E-10 -> 1E-10
  1059. emax253 toSci 1E-9 -> 1E-9
  1060. emax254 toSci 1E-8 -> 1E-8
  1061. emax255 toSci 1E+8 -> 1E+8
  1062. emax256 toSci 1E+9 -> 1E+9
  1063. emax257 toSci 1E+10 -> 1E+10
  1064. emax258 toSci 1E+11 -> Infinity Overflow Inexact Rounded
  1065. emax260 toSci 1.00E-21 -> 0E-18 Underflow Subnormal Inexact Rounded Clamped
  1066. emax261 toSci 1.00E-11 -> 1.00E-11 Subnormal
  1067. emax262 toSci 1.00E-10 -> 1.00E-10
  1068. emax263 toSci 1.00E-9 -> 1.00E-9
  1069. emax264 toSci 1.00E-8 -> 1.00E-8
  1070. emax265 toSci 1.00E+8 -> 1.00E+8
  1071. emax266 toSci 1.00E+9 -> 1.00E+9
  1072. emax267 toSci 1.00E+10 -> 1.00E+10
  1073. emax268 toSci 1.00E+11 -> Infinity Overflow Inexact Rounded
  1074. emax270 toSci 9.99E-21 -> 0E-18 Underflow Subnormal Inexact Rounded Clamped
  1075. emax271 toSci 9.99E-11 -> 9.99E-11 Subnormal
  1076. emax272 toSci 9.99E-10 -> 9.99E-10
  1077. emax273 toSci 9.99E-9 -> 9.99E-9
  1078. emax274 toSci 9.99E-8 -> 9.99E-8
  1079. emax275 toSci 9.99E+8 -> 9.99E+8
  1080. emax276 toSci 9.99E+9 -> 9.99E+9
  1081. emax277 toSci 9.99E+10 -> 9.99E+10
  1082. emax278 toSci 9.99E+11 -> Infinity Overflow Inexact Rounded
  1083. maxexponent: 99
  1084. minexponent: -99
  1085. emax280 toSci 1E-120 -> 0E-107 Underflow Subnormal Inexact Rounded Clamped
  1086. emax281 toSci 1E-100 -> 1E-100 Subnormal
  1087. emax282 toSci 1E-99 -> 1E-99
  1088. emax283 toSci 1E-98 -> 1E-98
  1089. emax284 toSci 1E+98 -> 1E+98
  1090. emax285 toSci 1E+99 -> 1E+99
  1091. emax286 toSci 1E+100 -> Infinity Overflow Inexact Rounded
  1092. maxexponent: 999
  1093. minexponent: -999
  1094. emax291 toSci 1E-1000 -> 1E-1000 Subnormal
  1095. emax292 toSci 1E-999 -> 1E-999
  1096. emax293 toSci 1E+999 -> 1E+999
  1097. emax294 toSci 1E+1000 -> Infinity Overflow Inexact Rounded
  1098. maxexponent: 9999
  1099. minexponent: -9999
  1100. emax301 toSci 1E-10000 -> 1E-10000 Subnormal
  1101. emax302 toSci 1E-9999 -> 1E-9999
  1102. emax303 toSci 1E+9999 -> 1E+9999
  1103. emax304 toSci 1E+10000 -> Infinity Overflow Inexact Rounded
  1104. maxexponent: 99999
  1105. minexponent: -99999
  1106. emax311 toSci 1E-100000 -> 1E-100000 Subnormal
  1107. emax312 toSci 1E-99999 -> 1E-99999
  1108. emax313 toSci 1E+99999 -> 1E+99999
  1109. emax314 toSci 1E+100000 -> Infinity Overflow Inexact Rounded
  1110. maxexponent: 999999
  1111. minexponent: -999999
  1112. emax321 toSci 1E-1000000 -> 1E-1000000 Subnormal
  1113. emax322 toSci 1E-999999 -> 1E-999999
  1114. emax323 toSci 1E+999999 -> 1E+999999
  1115. emax324 toSci 1E+1000000 -> Infinity Overflow Inexact Rounded
  1116. maxexponent: 9999999
  1117. minexponent: -9999999
  1118. emax331 toSci 1E-10000000 -> 1E-10000000 Subnormal
  1119. emax332 toSci 1E-9999999 -> 1E-9999999
  1120. emax333 toSci 1E+9999999 -> 1E+9999999
  1121. emax334 toSci 1E+10000000 -> Infinity Overflow Inexact Rounded
  1122. maxexponent: 99999999
  1123. minexponent: -99999999
  1124. emax341 toSci 1E-100000000 -> 1E-100000000 Subnormal
  1125. emax342 toSci 1E-99999999 -> 1E-99999999
  1126. emax343 toSci 1E+99999999 -> 1E+99999999
  1127. emax344 toSci 1E+100000000 -> Infinity Overflow Inexact Rounded
  1128. maxexponent: 999999999
  1129. minexponent: -999999999
  1130. emax347 toSci 1E-1000000008 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped
  1131. emax348 toSci 1E-1000000007 -> 1E-1000000007 Subnormal
  1132. emax349 toSci 1E-1000000000 -> 1E-1000000000 Subnormal
  1133. emax350 toSci 1E-999999999 -> 1E-999999999
  1134. emax351 toSci 1E+999999999 -> 1E+999999999
  1135. emax352 toSci 1E+1000000000 -> Infinity Overflow Inexact Rounded
  1136. emax353 toSci 1.000E-1000000000 -> 1.000E-1000000000 Subnormal
  1137. emax354 toSci 1.000E-999999999 -> 1.000E-999999999
  1138. emax355 toSci 1.000E+999999999 -> 1.000E+999999999
  1139. emax356 toSci 1.000E+1000000000 -> Infinity Overflow Inexact Rounded
  1140. emax357 toSci 1.001E-1000000008 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped
  1141. emax358 toSci 1.001E-1000000007 -> 1E-1000000007 Subnormal Inexact Rounded Underflow
  1142. emax359 toSci 1.001E-1000000000 -> 1.001E-1000000000 Subnormal
  1143. emax360 toSci 1.001E-999999999 -> 1.001E-999999999
  1144. emax361 toSci 1.001E+999999999 -> 1.001E+999999999
  1145. emax362 toSci 1.001E+1000000000 -> Infinity Overflow Inexact Rounded
  1146. emax363 toSci 9.000E-1000000000 -> 9.000E-1000000000 Subnormal
  1147. emax364 toSci 9.000E-999999999 -> 9.000E-999999999
  1148. emax365 toSci 9.000E+999999999 -> 9.000E+999999999
  1149. emax366 toSci 9.000E+1000000000 -> Infinity Overflow Inexact Rounded
  1150. emax367 toSci 9.999E-1000000009 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped
  1151. emax368 toSci 9.999E-1000000008 -> 1E-1000000007 Underflow Subnormal Inexact Rounded
  1152. emax369 toSci 9.999E-1000000007 -> 1.0E-1000000006 Underflow Subnormal Inexact Rounded
  1153. emax370 toSci 9.999E-1000000000 -> 9.999E-1000000000 Subnormal
  1154. emax371 toSci 9.999E-999999999 -> 9.999E-999999999
  1155. emax372 toSci 9.999E+999999999 -> 9.999E+999999999
  1156. emax373 toSci 9.999E+1000000000 -> Infinity Overflow Inexact Rounded
  1157. emax374 toSci -1E-1000000000 -> -1E-1000000000 Subnormal
  1158. emax375 toSci -1E-999999999 -> -1E-999999999
  1159. emax376 toSci -1E+999999999 -> -1E+999999999
  1160. emax377 toSci -1E+1000000000 -> -Infinity Overflow Inexact Rounded
  1161. emax378 toSci -1.000E-1000000000 -> -1.000E-1000000000 Subnormal
  1162. emax379 toSci -1.000E-999999999 -> -1.000E-999999999
  1163. emax380 toSci -1.000E+999999999 -> -1.000E+999999999
  1164. emax381 toSci -1.000E+1000000000 -> -Infinity Overflow Inexact Rounded
  1165. emax382 toSci -1.001E-1000000008 -> -0E-1000000007 Underflow Subnormal Inexact Rounded Clamped
  1166. emax383 toSci -1.001E-999999999 -> -1.001E-999999999
  1167. emax384 toSci -1.001E+999999999 -> -1.001E+999999999
  1168. emax385 toSci -1.001E+1000000000 -> -Infinity Overflow Inexact Rounded
  1169. emax386 toSci -9.000E-1000000123 -> -0E-1000000007 Underflow Subnormal Inexact Rounded Clamped
  1170. emax387 toSci -9.000E-999999999 -> -9.000E-999999999
  1171. emax388 toSci -9.000E+999999999 -> -9.000E+999999999
  1172. emax389 toSci -9.000E+1000000000 -> -Infinity Overflow Inexact Rounded
  1173. emax390 toSci -9.999E-1000000008 -> -1E-1000000007 Underflow Subnormal Inexact Rounded
  1174. emax391 toSci -9.999E-999999999 -> -9.999E-999999999
  1175. emax392 toSci -9.999E+999999999 -> -9.999E+999999999
  1176. emax393 toSci -9.999E+1000000000 -> -Infinity Overflow Inexact Rounded
  1177. -- Now check 854 rounding of subnormals and proper underflow to 0
  1178. precision: 5
  1179. maxExponent: 999
  1180. minexponent: -999
  1181. rounding: half_even
  1182. emax400 toSci 1.0000E-999 -> 1.0000E-999
  1183. emax401 toSci 0.1E-999 -> 1E-1000 Subnormal
  1184. emax402 toSci 0.1000E-999 -> 1.000E-1000 Subnormal
  1185. emax403 toSci 0.0100E-999 -> 1.00E-1001 Subnormal
  1186. emax404 toSci 0.0010E-999 -> 1.0E-1002 Subnormal
  1187. emax405 toSci 0.0001E-999 -> 1E-1003 Subnormal
  1188. emax406 toSci 0.00010E-999 -> 1E-1003 Subnormal Rounded
  1189. emax407 toSci 0.00013E-999 -> 1E-1003 Underflow Subnormal Inexact Rounded
  1190. emax408 toSci 0.00015E-999 -> 2E-1003 Underflow Subnormal Inexact Rounded
  1191. emax409 toSci 0.00017E-999 -> 2E-1003 Underflow Subnormal Inexact Rounded
  1192. emax410 toSci 0.00023E-999 -> 2E-1003 Underflow Subnormal Inexact Rounded
  1193. emax411 toSci 0.00025E-999 -> 2E-1003 Underflow Subnormal Inexact Rounded
  1194. emax412 toSci 0.00027E-999 -> 3E-1003 Underflow Subnormal Inexact Rounded
  1195. emax413 toSci 0.000149E-999 -> 1E-1003 Underflow Subnormal Inexact Rounded
  1196. emax414 toSci 0.000150E-999 -> 2E-1003 Underflow Subnormal Inexact Rounded
  1197. emax415 toSci 0.000151E-999 -> 2E-1003 Underflow Subnormal Inexact Rounded
  1198. emax416 toSci 0.000249E-999 -> 2E-1003 Underflow Subnormal Inexact Rounded
  1199. emax417 toSci 0.000250E-999 -> 2E-1003 Underflow Subnormal Inexact Rounded
  1200. emax418 toSci 0.000251E-999 -> 3E-1003 Underflow Subnormal Inexact Rounded
  1201. emax419 toSci 0.00009E-999 -> 1E-1003 Underflow Subnormal Inexact Rounded
  1202. emax420 toSci 0.00005E-999 -> 0E-1003 Underflow Subnormal Inexact Rounded Clamped
  1203. emax421 toSci 0.00003E-999 -> 0E-1003 Underflow Subnormal Inexact Rounded Clamped
  1204. emax422 toSci 0.000009E-999 -> 0E-1003 Underflow Subnormal Inexact Rounded Clamped
  1205. emax423 toSci 0.000005E-999 -> 0E-1003 Underflow Subnormal Inexact Rounded Clamped
  1206. emax424 toSci 0.000003E-999 -> 0E-1003 Underflow Subnormal Inexact Rounded Clamped
  1207. emax425 toSci 0.001049E-999 -> 1.0E-1002 Underflow Subnormal Inexact Rounded
  1208. emax426 toSci 0.001050E-999 -> 1.0E-1002 Underflow Subnormal Inexact Rounded
  1209. emax427 toSci 0.001051E-999 -> 1.1E-1002 Underflow Subnormal Inexact Rounded
  1210. emax428 toSci 0.001149E-999 -> 1.1E-1002 Underflow Subnormal Inexact Rounded
  1211. emax429 toSci 0.001150E-999 -> 1.2E-1002 Underflow Subnormal Inexact Rounded
  1212. emax430 toSci 0.001151E-999 -> 1.2E-1002 Underflow Subnormal Inexact Rounded
  1213. emax432 toSci 0.010049E-999 -> 1.00E-1001 Underflow Subnormal Inexact Rounded
  1214. emax433 toSci 0.010050E-999 -> 1.00E-1001 Underflow Subnormal Inexact Rounded
  1215. emax434 toSci 0.010051E-999 -> 1.01E-1001 Underflow Subnormal Inexact Rounded
  1216. emax435 toSci 0.010149E-999 -> 1.01E-1001 Underflow Subnormal Inexact Rounded
  1217. emax436 toSci 0.010150E-999 -> 1.02E-1001 Underflow Subnormal Inexact Rounded
  1218. emax437 toSci 0.010151E-999 -> 1.02E-1001 Underflow Subnormal Inexact Rounded
  1219. emax440 toSci 0.10103E-999 -> 1.010E-1000 Underflow Subnormal Inexact Rounded
  1220. emax441 toSci 0.10105E-999 -> 1.010E-1000 Underflow Subnormal Inexact Rounded
  1221. emax442 toSci 0.10107E-999 -> 1.011E-1000 Underflow Subnormal Inexact Rounded
  1222. emax443 toSci 0.10113E-999 -> 1.011E-1000 Underflow Subnormal Inexact Rounded
  1223. emax444 toSci 0.10115E-999 -> 1.012E-1000 Underflow Subnormal Inexact Rounded
  1224. emax445 toSci 0.10117E-999 -> 1.012E-1000 Underflow Subnormal Inexact Rounded
  1225. emax450 toSci 1.10730E-1000 -> 1.107E-1000 Underflow Subnormal Inexact Rounded
  1226. emax451 toSci 1.10750E-1000 -> 1.108E-1000 Underflow Subnormal Inexact Rounded
  1227. emax452 toSci 1.10770E-1000 -> 1.108E-1000 Underflow Subnormal Inexact Rounded
  1228. emax453 toSci 1.10830E-1000 -> 1.108E-1000 Underflow Subnormal Inexact Rounded
  1229. emax454 toSci 1.10850E-1000 -> 1.108E-1000 Underflow Subnormal Inexact Rounded
  1230. emax455 toSci 1.10870E-1000 -> 1.109E-1000 Underflow Subnormal Inexact Rounded
  1231. -- make sure sign OK
  1232. emax456 toSci -0.10103E-999 -> -1.010E-1000 Underflow Subnormal Inexact Rounded
  1233. emax457 toSci -0.10105E-999 -> -1.010E-1000 Underflow Subnormal Inexact Rounded
  1234. emax458 toSci -0.10107E-999 -> -1.011E-1000 Underflow Subnormal Inexact Rounded
  1235. emax459 toSci -0.10113E-999 -> -1.011E-1000 Underflow Subnormal Inexact Rounded
  1236. emax460 toSci -0.10115E-999 -> -1.012E-1000 Underflow Subnormal Inexact Rounded
  1237. emax461 toSci -0.10117E-999 -> -1.012E-1000 Underflow Subnormal Inexact Rounded
  1238. -- '999s' cases
  1239. emax464 toSci 999999E-999 -> 1.0000E-993 Inexact Rounded
  1240. emax465 toSci 99999.0E-999 -> 9.9999E-995 Rounded
  1241. emax466 toSci 99999.E-999 -> 9.9999E-995
  1242. emax467 toSci 9999.9E-999 -> 9.9999E-996
  1243. emax468 toSci 999.99E-999 -> 9.9999E-997
  1244. emax469 toSci 99.999E-999 -> 9.9999E-998
  1245. emax470 toSci 9.9999E-999 -> 9.9999E-999
  1246. emax471 toSci 0.99999E-999 -> 1.0000E-999 Underflow Subnormal Inexact Rounded
  1247. emax472 toSci 0.099999E-999 -> 1.000E-1000 Underflow Subnormal Inexact Rounded
  1248. emax473 toSci 0.0099999E-999 -> 1.00E-1001 Underflow Subnormal Inexact Rounded
  1249. emax474 toSci 0.00099999E-999 -> 1.0E-1002 Underflow Subnormal Inexact Rounded
  1250. emax475 toSci 0.000099999E-999 -> 1E-1003 Underflow Subnormal Inexact Rounded
  1251. emax476 toSci 0.0000099999E-999 -> 0E-1003 Underflow Subnormal Inexact Rounded Clamped
  1252. emax477 toSci 0.00000099999E-999 -> 0E-1003 Underflow Subnormal Inexact Rounded Clamped
  1253. emax478 toSci 0.000000099999E-999 -> 0E-1003 Underflow Subnormal Inexact Rounded Clamped
  1254. -- Exponents with insignificant leading zeros
  1255. precision: 16
  1256. maxExponent: 999999999
  1257. minexponent: -999999999
  1258. basx1001 toSci 1e999999999 -> 1E+999999999
  1259. basx1002 toSci 1e0999999999 -> 1E+999999999
  1260. basx1003 toSci 1e00999999999 -> 1E+999999999
  1261. basx1004 toSci 1e000999999999 -> 1E+999999999
  1262. basx1005 toSci 1e000000000000999999999 -> 1E+999999999
  1263. basx1006 toSci 1e000000000001000000007 -> Infinity Overflow Inexact Rounded
  1264. basx1007 toSci 1e-999999999 -> 1E-999999999
  1265. basx1008 toSci 1e-0999999999 -> 1E-999999999
  1266. basx1009 toSci 1e-00999999999 -> 1E-999999999
  1267. basx1010 toSci 1e-000999999999 -> 1E-999999999
  1268. basx1011 toSci 1e-000000000000999999999 -> 1E-999999999
  1269. basx1012 toSci 1e-000000000001000000007 -> 1E-1000000007 Subnormal
  1270. -- Edge cases for int32 exponents...
  1271. basx1021 tosci 1e+2147483649 -> Infinity Overflow Inexact Rounded
  1272. basx1022 tosci 1e+2147483648 -> Infinity Overflow Inexact Rounded
  1273. basx1023 tosci 1e+2147483647 -> Infinity Overflow Inexact Rounded
  1274. basx1024 tosci 1e-2147483647 -> 0E-1000000014 Underflow Subnormal Inexact Rounded Clamped
  1275. basx1025 tosci 1e-2147483648 -> 0E-1000000014 Underflow Subnormal Inexact Rounded Clamped
  1276. basx1026 tosci 1e-2147483649 -> 0E-1000000014 Underflow Subnormal Inexact Rounded Clamped
  1277. -- same unbalanced
  1278. precision: 7
  1279. maxExponent: 96
  1280. minexponent: -95
  1281. basx1031 tosci 1e+2147483649 -> Infinity Overflow Inexact Rounded
  1282. basx1032 tosci 1e+2147483648 -> Infinity Overflow Inexact Rounded
  1283. basx1033 tosci 1e+2147483647 -> Infinity Overflow Inexact Rounded
  1284. basx1034 tosci 1e-2147483647 -> 0E-101 Underflow Subnormal Inexact Rounded Clamped
  1285. basx1035 tosci 1e-2147483648 -> 0E-101 Underflow Subnormal Inexact Rounded Clamped
  1286. basx1036 tosci 1e-2147483649 -> 0E-101 Underflow Subnormal Inexact Rounded Clamped
  1287. -- check for double-rounded subnormals
  1288. precision: 5
  1289. maxexponent: 79
  1290. minexponent: -79
  1291. basx1041 toSci 1.52444E-80 -> 1.524E-80 Inexact Rounded Subnormal Underflow
  1292. basx1042 toSci 1.52445E-80 -> 1.524E-80 Inexact Rounded Subnormal Underflow
  1293. basx1043 toSci 1.52446E-80 -> 1.524E-80 Inexact Rounded Subnormal Underflow
  1294. -- clamped zeros [see also clamp.decTest]
  1295. precision: 34
  1296. maxExponent: 6144
  1297. minExponent: -6143
  1298. basx1061 apply 0e+10000 -> 0E+6144 Clamped
  1299. basx1062 apply 0e-10000 -> 0E-6176 Clamped
  1300. basx1063 apply -0e+10000 -> -0E+6144 Clamped
  1301. basx1064 apply -0e-10000 -> -0E-6176 Clamped
  1302. precision: 16
  1303. maxExponent: 384
  1304. minExponent: -383
  1305. basx1065 apply 0e+10000 -> 0E+384 Clamped
  1306. basx1066 apply 0e-10000 -> 0E-398 Clamped
  1307. basx1067 apply -0e+10000 -> -0E+384 Clamped
  1308. basx1068 apply -0e-10000 -> -0E-398 Clamped
  1309. -- same with IEEE clamping
  1310. clamp: 1
  1311. precision: 34
  1312. maxExponent: 6144
  1313. minExponent: -6143
  1314. basx1071 apply 0e+10000 -> 0E+6111 Clamped
  1315. basx1072 apply 0e-10000 -> 0E-6176 Clamped
  1316. basx1073 apply -0e+10000 -> -0E+6111 Clamped
  1317. basx1074 apply -0e-10000 -> -0E-6176 Clamped
  1318. precision: 16
  1319. maxExponent: 384
  1320. minExponent: -383
  1321. basx1075 apply 0e+10000 -> 0E+369 Clamped
  1322. basx1076 apply 0e-10000 -> 0E-398 Clamped
  1323. basx1077 apply -0e+10000 -> -0E+369 Clamped
  1324. basx1078 apply -0e-10000 -> -0E-398 Clamped