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