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