1023dd3b8Sopenharmony_ciif (typeof T === 'undefined') require('../setup');
2023dd3b8Sopenharmony_ci
3023dd3b8Sopenharmony_ciT('Decimal', function () {
4023dd3b8Sopenharmony_ci
5023dd3b8Sopenharmony_ci  Decimal.config({
6023dd3b8Sopenharmony_ci    precision: 40,
7023dd3b8Sopenharmony_ci    rounding: 4,
8023dd3b8Sopenharmony_ci    toExpNeg: -9e15,
9023dd3b8Sopenharmony_ci    toExpPos: 9e15,
10023dd3b8Sopenharmony_ci    maxE: 9e15,
11023dd3b8Sopenharmony_ci    minE: -9e15,
12023dd3b8Sopenharmony_ci    crypto: false,
13023dd3b8Sopenharmony_ci    modulo: 1
14023dd3b8Sopenharmony_ci  });
15023dd3b8Sopenharmony_ci
16023dd3b8Sopenharmony_ci  var t = function (coefficient, exponent, sign, n) {
17023dd3b8Sopenharmony_ci    T.assertEqualProps(coefficient, exponent, sign, new Decimal(n));
18023dd3b8Sopenharmony_ci  }
19023dd3b8Sopenharmony_ci
20023dd3b8Sopenharmony_ci  t([0], 0, 1, 0);
21023dd3b8Sopenharmony_ci  t([0], 0, -1, -0);
22023dd3b8Sopenharmony_ci  t([1], 0, -1, -1);
23023dd3b8Sopenharmony_ci  t([10], 1, -1, -10);
24023dd3b8Sopenharmony_ci
25023dd3b8Sopenharmony_ci  t([1], 0, 1, 1);
26023dd3b8Sopenharmony_ci  t([10], 1, 1, 10);
27023dd3b8Sopenharmony_ci  t([100], 2, 1, 100);
28023dd3b8Sopenharmony_ci  t([1000], 3, 1, 1000);
29023dd3b8Sopenharmony_ci  t([10000], 4, 1, 10000);
30023dd3b8Sopenharmony_ci  t([100000], 5, 1, 100000);
31023dd3b8Sopenharmony_ci  t([1000000], 6, 1, 1000000);
32023dd3b8Sopenharmony_ci
33023dd3b8Sopenharmony_ci  t([1], 7, 1, 10000000);
34023dd3b8Sopenharmony_ci  t([10], 8, 1, 100000000);
35023dd3b8Sopenharmony_ci  t([100], 9, 1, 1000000000);
36023dd3b8Sopenharmony_ci  t([1000], 10, 1, 10000000000);
37023dd3b8Sopenharmony_ci  t([10000], 11, 1, 100000000000);
38023dd3b8Sopenharmony_ci  t([100000], 12, 1, 1000000000000);
39023dd3b8Sopenharmony_ci  t([1000000], 13, 1, 10000000000000);
40023dd3b8Sopenharmony_ci
41023dd3b8Sopenharmony_ci  t([1], 14, -1, -100000000000000);
42023dd3b8Sopenharmony_ci  t([10], 15, -1, -1000000000000000);
43023dd3b8Sopenharmony_ci  t([100], 16, -1, -10000000000000000);
44023dd3b8Sopenharmony_ci  t([1000], 17, -1, -100000000000000000);
45023dd3b8Sopenharmony_ci  t([10000], 18, -1, -1000000000000000000);
46023dd3b8Sopenharmony_ci  t([100000], 19, -1, -10000000000000000000);
47023dd3b8Sopenharmony_ci  t([1000000], 20, -1, -100000000000000000000);
48023dd3b8Sopenharmony_ci
49023dd3b8Sopenharmony_ci  t([1000000], -1, 1, 1e-1);
50023dd3b8Sopenharmony_ci  t([100000], -2, -1, -1e-2);
51023dd3b8Sopenharmony_ci  t([10000], -3, 1, 1e-3);
52023dd3b8Sopenharmony_ci  t([1000], -4, -1, -1e-4);
53023dd3b8Sopenharmony_ci  t([100], -5, 1, 1e-5);
54023dd3b8Sopenharmony_ci  t([10], -6, -1, -1e-6);
55023dd3b8Sopenharmony_ci  t([1], -7, 1, 1e-7);
56023dd3b8Sopenharmony_ci
57023dd3b8Sopenharmony_ci  t([1000000], -8, 1, 1e-8);
58023dd3b8Sopenharmony_ci  t([100000], -9, -1, -1e-9);
59023dd3b8Sopenharmony_ci  t([10000], -10, 1, 1e-10);
60023dd3b8Sopenharmony_ci  t([1000], -11, -1, -1e-11);
61023dd3b8Sopenharmony_ci  t([100], -12, 1, 1e-12);
62023dd3b8Sopenharmony_ci  t([10], -13, -1, -1e-13);
63023dd3b8Sopenharmony_ci  t([1], -14, 1, 1e-14);
64023dd3b8Sopenharmony_ci
65023dd3b8Sopenharmony_ci  t([1000000], -15, 1, 1e-15);
66023dd3b8Sopenharmony_ci  t([100000], -16, -1, -1e-16);
67023dd3b8Sopenharmony_ci  t([10000], -17, 1, 1e-17);
68023dd3b8Sopenharmony_ci  t([1000], -18, -1, -1e-18);
69023dd3b8Sopenharmony_ci  t([100], -19, 1, 1e-19);
70023dd3b8Sopenharmony_ci  t([10], -20, -1, -1e-20);
71023dd3b8Sopenharmony_ci  t([1], -21, 1, 1e-21);
72023dd3b8Sopenharmony_ci
73023dd3b8Sopenharmony_ci  t([9], 0, 1, '9');
74023dd3b8Sopenharmony_ci  t([99], 1, -1, '-99');
75023dd3b8Sopenharmony_ci  t([999], 2, 1, '999');
76023dd3b8Sopenharmony_ci  t([9999], 3, -1, '-9999');
77023dd3b8Sopenharmony_ci  t([99999], 4, 1, '99999');
78023dd3b8Sopenharmony_ci  t([999999], 5, -1, '-999999');
79023dd3b8Sopenharmony_ci  t([9999999], 6, 1, '9999999');
80023dd3b8Sopenharmony_ci
81023dd3b8Sopenharmony_ci  t([9, 9999999], 7, -1, '-99999999');
82023dd3b8Sopenharmony_ci  t([99, 9999999], 8, 1, '999999999');
83023dd3b8Sopenharmony_ci  t([999, 9999999], 9, -1, '-9999999999');
84023dd3b8Sopenharmony_ci  t([9999, 9999999], 10, 1, '99999999999');
85023dd3b8Sopenharmony_ci  t([99999, 9999999], 11, -1, '-999999999999');
86023dd3b8Sopenharmony_ci  t([999999, 9999999], 12, 1, '9999999999999');
87023dd3b8Sopenharmony_ci  t([9999999, 9999999], 13, -1, '-99999999999999');
88023dd3b8Sopenharmony_ci
89023dd3b8Sopenharmony_ci  t([9, 9999999, 9999999], 14, 1, '999999999999999');
90023dd3b8Sopenharmony_ci  t([99, 9999999, 9999999], 15, -1, '-9999999999999999');
91023dd3b8Sopenharmony_ci  t([999, 9999999, 9999999], 16, 1, '99999999999999999');
92023dd3b8Sopenharmony_ci  t([9999, 9999999, 9999999], 17, -1, '-999999999999999999');
93023dd3b8Sopenharmony_ci  t([99999, 9999999, 9999999], 18, 1, '9999999999999999999');
94023dd3b8Sopenharmony_ci  t([999999, 9999999, 9999999], 19, -1, '-99999999999999999999');
95023dd3b8Sopenharmony_ci  t([9999999, 9999999, 9999999], 20, 1, '999999999999999999999');
96023dd3b8Sopenharmony_ci
97023dd3b8Sopenharmony_ci  // Test base conversion.
98023dd3b8Sopenharmony_ci
99023dd3b8Sopenharmony_ci  t = function (expected, n) {
100023dd3b8Sopenharmony_ci    T.assertEqual(expected, new Decimal(n).valueOf());
101023dd3b8Sopenharmony_ci  }
102023dd3b8Sopenharmony_ci
103023dd3b8Sopenharmony_ci  function randInt() {
104023dd3b8Sopenharmony_ci    return Math.floor(Math.random() * 0x20000000000000 / Math.pow(10, Math.random() * 16 | 0));
105023dd3b8Sopenharmony_ci  }
106023dd3b8Sopenharmony_ci
107023dd3b8Sopenharmony_ci  // Test random integers against Number.prototype.toString(base).
108023dd3b8Sopenharmony_ci  for (var k, i = 0; i < 127; i++) {
109023dd3b8Sopenharmony_ci    k = randInt();
110023dd3b8Sopenharmony_ci    t(k.toString(), '0b' + k.toString(2));
111023dd3b8Sopenharmony_ci    k = randInt();
112023dd3b8Sopenharmony_ci    t(k.toString(), '0B' + k.toString(2));
113023dd3b8Sopenharmony_ci    k = randInt();
114023dd3b8Sopenharmony_ci    t(k.toString(), '0o' + k.toString(8));
115023dd3b8Sopenharmony_ci    k = randInt();
116023dd3b8Sopenharmony_ci    t(k.toString(), '0O' + k.toString(8));
117023dd3b8Sopenharmony_ci    k = randInt();
118023dd3b8Sopenharmony_ci    t(k.toString(), '0x' + k.toString(16));
119023dd3b8Sopenharmony_ci    k = randInt();
120023dd3b8Sopenharmony_ci    t(k.toString(), '0X' + k.toString(16));
121023dd3b8Sopenharmony_ci  }
122023dd3b8Sopenharmony_ci
123023dd3b8Sopenharmony_ci  // Binary.
124023dd3b8Sopenharmony_ci  t('0', '0b0');
125023dd3b8Sopenharmony_ci  t('0', '0B0');
126023dd3b8Sopenharmony_ci  t('-5', '-0b101');
127023dd3b8Sopenharmony_ci  t('5', '+0b101');
128023dd3b8Sopenharmony_ci  t('1.5', '0b1.1');
129023dd3b8Sopenharmony_ci  t('-1.5', '-0b1.1');
130023dd3b8Sopenharmony_ci
131023dd3b8Sopenharmony_ci  t('18181', '0b100011100000101.00');
132023dd3b8Sopenharmony_ci  t('-12.5', '-0b1100.10');
133023dd3b8Sopenharmony_ci  t('343872.5', '0b1010011111101000000.10');
134023dd3b8Sopenharmony_ci  t('-328.28125', '-0b101001000.010010');
135023dd3b8Sopenharmony_ci  t('-341919.144535064697265625', '-0b1010011011110011111.0010010100000000010');
136023dd3b8Sopenharmony_ci  t('97.10482025146484375', '0b1100001.000110101101010110000');
137023dd3b8Sopenharmony_ci  t('-120914.40625', '-0b11101100001010010.01101');
138023dd3b8Sopenharmony_ci  t('8080777260861123367657', '0b1101101100000111101001111111010001111010111011001010100101001001011101001');
139023dd3b8Sopenharmony_ci
140023dd3b8Sopenharmony_ci  // Octal.
141023dd3b8Sopenharmony_ci  t('8', '0o10');
142023dd3b8Sopenharmony_ci  t('-8.5', '-0O010.4');
143023dd3b8Sopenharmony_ci  t('8.5', '+0O010.4');
144023dd3b8Sopenharmony_ci  t('-262144.000000059604644775390625', '-0o1000000.00000001');
145023dd3b8Sopenharmony_ci  t('572315667420.390625', '0o10250053005734.31');
146023dd3b8Sopenharmony_ci
147023dd3b8Sopenharmony_ci  // Hex.
148023dd3b8Sopenharmony_ci  t('1', '0x00001');
149023dd3b8Sopenharmony_ci  t('255', '0xff');
150023dd3b8Sopenharmony_ci  t('-15.5', '-0Xf.8');
151023dd3b8Sopenharmony_ci  t('15.5', '+0Xf.8');
152023dd3b8Sopenharmony_ci  t('-16777216.00000000023283064365386962890625', '-0x1000000.00000001');
153023dd3b8Sopenharmony_ci  t('325927753012307620476767402981591827744994693483231017778102969592507', '0xc16de7aa5bf90c3755ef4dea45e982b351b6e00cd25a82dcfe0646abb');
154023dd3b8Sopenharmony_ci
155023dd3b8Sopenharmony_ci  // Test parsing.
156023dd3b8Sopenharmony_ci
157023dd3b8Sopenharmony_ci  var tx = function (fn, msg) {
158023dd3b8Sopenharmony_ci    T.assertException(fn, msg);
159023dd3b8Sopenharmony_ci  }
160023dd3b8Sopenharmony_ci
161023dd3b8Sopenharmony_ci  t('NaN', NaN);
162023dd3b8Sopenharmony_ci  t('NaN', -NaN);
163023dd3b8Sopenharmony_ci  t('NaN', 'NaN');
164023dd3b8Sopenharmony_ci  t('NaN', '-NaN');
165023dd3b8Sopenharmony_ci  t('NaN', '+NaN');
166023dd3b8Sopenharmony_ci
167023dd3b8Sopenharmony_ci  tx(function () {new Decimal(' NaN')}, "' NaN'");
168023dd3b8Sopenharmony_ci  tx(function () {new Decimal('NaN ')}, "'NaN '");
169023dd3b8Sopenharmony_ci  tx(function () {new Decimal(' NaN ')}, "' NaN '");
170023dd3b8Sopenharmony_ci  tx(function () {new Decimal(' -NaN')}, "' -NaN'");
171023dd3b8Sopenharmony_ci  tx(function () {new Decimal(' +NaN')}, "' +NaN'");
172023dd3b8Sopenharmony_ci  tx(function () {new Decimal('-NaN ')}, "'-NaN '");
173023dd3b8Sopenharmony_ci  tx(function () {new Decimal('+NaN ')}, "'+NaN '");
174023dd3b8Sopenharmony_ci  tx(function () {new Decimal('.NaN')}, "'.NaN'");
175023dd3b8Sopenharmony_ci  tx(function () {new Decimal('NaN.')}, "'NaN.'");
176023dd3b8Sopenharmony_ci
177023dd3b8Sopenharmony_ci  t('Infinity', Infinity);
178023dd3b8Sopenharmony_ci  t('-Infinity', -Infinity);
179023dd3b8Sopenharmony_ci  t('Infinity', 'Infinity');
180023dd3b8Sopenharmony_ci  t('-Infinity', '-Infinity');
181023dd3b8Sopenharmony_ci  t('Infinity', '+Infinity');
182023dd3b8Sopenharmony_ci
183023dd3b8Sopenharmony_ci  tx(function () {new Decimal(' Infinity')}, "' Infinity '");
184023dd3b8Sopenharmony_ci  tx(function () {new Decimal('Infinity ')}, "'Infinity '");
185023dd3b8Sopenharmony_ci  tx(function () {new Decimal(' Infinity ')}, "' Infinity '");
186023dd3b8Sopenharmony_ci  tx(function () {new Decimal(' -Infinity')}, "' -Infinity'");
187023dd3b8Sopenharmony_ci  tx(function () {new Decimal(' +Infinity')}, "' +Infinity'");
188023dd3b8Sopenharmony_ci  tx(function () {new Decimal('.Infinity')}, "'.Infinity'");
189023dd3b8Sopenharmony_ci  tx(function () {new Decimal('Infinity.')}, "'Infinity.'");
190023dd3b8Sopenharmony_ci
191023dd3b8Sopenharmony_ci  t('0', 0);
192023dd3b8Sopenharmony_ci  t('-0', -0);
193023dd3b8Sopenharmony_ci  t('0', '0');
194023dd3b8Sopenharmony_ci  t('-0', '-0');
195023dd3b8Sopenharmony_ci  t('0', '0.');
196023dd3b8Sopenharmony_ci  t('-0', '-0.');
197023dd3b8Sopenharmony_ci  t('0', '0.0');
198023dd3b8Sopenharmony_ci  t('-0', '-0.0');
199023dd3b8Sopenharmony_ci  t('0', '0.00000000');
200023dd3b8Sopenharmony_ci  t('-0', '-0.0000000000000000000000');
201023dd3b8Sopenharmony_ci
202023dd3b8Sopenharmony_ci  tx(function () {new Decimal(' 0')}, "' 0'");
203023dd3b8Sopenharmony_ci  tx(function () {new Decimal('0 ')}, "'0 '");
204023dd3b8Sopenharmony_ci  tx(function () {new Decimal(' 0 ')}, "' 0 '");
205023dd3b8Sopenharmony_ci  tx(function () {new Decimal('0-')}, "'0-'");
206023dd3b8Sopenharmony_ci  tx(function () {new Decimal(' -0')}, "' -0'");
207023dd3b8Sopenharmony_ci  tx(function () {new Decimal('-0 ')}, "'-0 '");
208023dd3b8Sopenharmony_ci  tx(function () {new Decimal('+0 ')}, "'+0 '");
209023dd3b8Sopenharmony_ci  tx(function () {new Decimal(' +0')}, "' +0'");
210023dd3b8Sopenharmony_ci  tx(function () {new Decimal(' .0')}, "' .0'");
211023dd3b8Sopenharmony_ci  tx(function () {new Decimal('0. ')}, "'0. '");
212023dd3b8Sopenharmony_ci  tx(function () {new Decimal('+-0')}, "'+-0'");
213023dd3b8Sopenharmony_ci  tx(function () {new Decimal('-+0')}, "'-+0'");
214023dd3b8Sopenharmony_ci  tx(function () {new Decimal('--0')}, "'--0'");
215023dd3b8Sopenharmony_ci  tx(function () {new Decimal('++0')}, "'++0'");
216023dd3b8Sopenharmony_ci  tx(function () {new Decimal('.-0')}, "'.-0'");
217023dd3b8Sopenharmony_ci  tx(function () {new Decimal('.+0')}, "'.+0'");
218023dd3b8Sopenharmony_ci  tx(function () {new Decimal('0 .')}, "'0 .'");
219023dd3b8Sopenharmony_ci  tx(function () {new Decimal('. 0')}, "'. 0'");
220023dd3b8Sopenharmony_ci  tx(function () {new Decimal('..0')}, "'..0'");
221023dd3b8Sopenharmony_ci  tx(function () {new Decimal('+.-0')}, "'+.-0'");
222023dd3b8Sopenharmony_ci  tx(function () {new Decimal('-.+0')}, "'-.+0'");
223023dd3b8Sopenharmony_ci  tx(function () {new Decimal('+. 0')}, "'+. 0'");
224023dd3b8Sopenharmony_ci  tx(function () {new Decimal('.0.')}, "'.0.'");
225023dd3b8Sopenharmony_ci
226023dd3b8Sopenharmony_ci  t('1', 1);
227023dd3b8Sopenharmony_ci  t('-1', -1);
228023dd3b8Sopenharmony_ci  t('1', '1');
229023dd3b8Sopenharmony_ci  t('-1', '-1');
230023dd3b8Sopenharmony_ci  t('0.1', '.1');
231023dd3b8Sopenharmony_ci  t('0.1', '.1');
232023dd3b8Sopenharmony_ci  t('-0.1', '-.1');
233023dd3b8Sopenharmony_ci  t('0.1', '+.1');
234023dd3b8Sopenharmony_ci  t('1', '1.');
235023dd3b8Sopenharmony_ci  t('1', '1.0');
236023dd3b8Sopenharmony_ci  t('-1', '-1.');
237023dd3b8Sopenharmony_ci  t('1', '+1.');
238023dd3b8Sopenharmony_ci  t('-1', '-1.0000');
239023dd3b8Sopenharmony_ci  t('1', '1.0000');
240023dd3b8Sopenharmony_ci  t('1', '1.00000000');
241023dd3b8Sopenharmony_ci  t('-1', '-1.000000000000000000000000');
242023dd3b8Sopenharmony_ci  t('1', '+1.000000000000000000000000');
243023dd3b8Sopenharmony_ci
244023dd3b8Sopenharmony_ci  tx(function () {new Decimal(' 1')}, "' 1'");
245023dd3b8Sopenharmony_ci  tx(function () {new Decimal('1 ')}, "'1 '");
246023dd3b8Sopenharmony_ci  tx(function () {new Decimal(' 1 ')}, "' 1 '");
247023dd3b8Sopenharmony_ci  tx(function () {new Decimal('1-')}, "'1-'");
248023dd3b8Sopenharmony_ci  tx(function () {new Decimal(' -1')}, "' -1'");
249023dd3b8Sopenharmony_ci  tx(function () {new Decimal('-1 ')}, "'-1 '");
250023dd3b8Sopenharmony_ci  tx(function () {new Decimal(' +1')}, "' +1'");
251023dd3b8Sopenharmony_ci  tx(function () {new Decimal('+1 ')}, "'+1'");
252023dd3b8Sopenharmony_ci  tx(function () {new Decimal('.1.')}, "'.1.'");
253023dd3b8Sopenharmony_ci  tx(function () {new Decimal('+-1')}, "'+-1'");
254023dd3b8Sopenharmony_ci  tx(function () {new Decimal('-+1')}, "'-+1'");
255023dd3b8Sopenharmony_ci  tx(function () {new Decimal('--1')}, "'--1'");
256023dd3b8Sopenharmony_ci  tx(function () {new Decimal('++1')}, "'++1'");
257023dd3b8Sopenharmony_ci  tx(function () {new Decimal('.-1')}, "'.-1'");
258023dd3b8Sopenharmony_ci  tx(function () {new Decimal('.+1')}, "'.+1'");
259023dd3b8Sopenharmony_ci  tx(function () {new Decimal('1 .')}, "'1 .'");
260023dd3b8Sopenharmony_ci  tx(function () {new Decimal('. 1')}, "'. 1'");
261023dd3b8Sopenharmony_ci  tx(function () {new Decimal('..1')}, "'..1'");
262023dd3b8Sopenharmony_ci  tx(function () {new Decimal('+.-1')}, "'+.-1'");
263023dd3b8Sopenharmony_ci  tx(function () {new Decimal('-.+1')}, "'-.+1'");
264023dd3b8Sopenharmony_ci  tx(function () {new Decimal('+. 1')}, "'+. 1'");
265023dd3b8Sopenharmony_ci  tx(function () {new Decimal('-. 1')}, "'-. 1'");
266023dd3b8Sopenharmony_ci  tx(function () {new Decimal('1..')}, "'1..'");
267023dd3b8Sopenharmony_ci  tx(function () {new Decimal('+1..')}, "'+1..'");
268023dd3b8Sopenharmony_ci  tx(function () {new Decimal('-1..')}, "'-1..'");
269023dd3b8Sopenharmony_ci  tx(function () {new Decimal('-.1.')}, "'-.1.'");
270023dd3b8Sopenharmony_ci  tx(function () {new Decimal('+.1.')}, "'+.1.'");
271023dd3b8Sopenharmony_ci  tx(function () {new Decimal('.-10.')}, "'.-10.'");
272023dd3b8Sopenharmony_ci  tx(function () {new Decimal('.+10.')}, "'.+10.'");
273023dd3b8Sopenharmony_ci  tx(function () {new Decimal('. 10.')}, "'. 10.'");
274023dd3b8Sopenharmony_ci
275023dd3b8Sopenharmony_ci  t('123.456789', 123.456789);
276023dd3b8Sopenharmony_ci  t('-123.456789', -123.456789);
277023dd3b8Sopenharmony_ci  t('-123.456789', '-123.456789');
278023dd3b8Sopenharmony_ci  t('123.456789', '123.456789');
279023dd3b8Sopenharmony_ci  t('123.456789', '+123.456789');
280023dd3b8Sopenharmony_ci
281023dd3b8Sopenharmony_ci  tx(function () {new Decimal(void 0)}, "void 0");
282023dd3b8Sopenharmony_ci  tx(function () {new Decimal('undefined')}, "'undefined'");
283023dd3b8Sopenharmony_ci  tx(function () {new Decimal(null)}, "null");
284023dd3b8Sopenharmony_ci  tx(function () {new Decimal('null')}, "'null'");
285023dd3b8Sopenharmony_ci  tx(function () {new Decimal({})}, "{}");
286023dd3b8Sopenharmony_ci  tx(function () {new Decimal([])}, "[]");
287023dd3b8Sopenharmony_ci  tx(function () {new Decimal(function () {})}, "function () {}");
288023dd3b8Sopenharmony_ci  tx(function () {new Decimal(new Date)}, "new Date");
289023dd3b8Sopenharmony_ci  tx(function () {new Decimal(new RegExp)}, "new RegExp");
290023dd3b8Sopenharmony_ci  tx(function () {new Decimal('')}, "''");
291023dd3b8Sopenharmony_ci  tx(function () {new Decimal(' ')}, "' '");
292023dd3b8Sopenharmony_ci  tx(function () {new Decimal('nan')}, "'nan'");
293023dd3b8Sopenharmony_ci  tx(function () {new Decimal('23e')}, "'23e'");
294023dd3b8Sopenharmony_ci  tx(function () {new Decimal('e4')}, "'e4'");
295023dd3b8Sopenharmony_ci  tx(function () {new Decimal('ff')}, "'ff'");
296023dd3b8Sopenharmony_ci  tx(function () {new Decimal('0xg')}, "'oxg'");
297023dd3b8Sopenharmony_ci  tx(function () {new Decimal('0Xfi')}, "'0Xfi'");
298023dd3b8Sopenharmony_ci  tx(function () {new Decimal('++45')}, "'++45'");
299023dd3b8Sopenharmony_ci  tx(function () {new Decimal('--45')}, "'--45'");
300023dd3b8Sopenharmony_ci  tx(function () {new Decimal('9.99--')}, "'9.99--'");
301023dd3b8Sopenharmony_ci  tx(function () {new Decimal('9.99++')}, "'9.99++'");
302023dd3b8Sopenharmony_ci  tx(function () {new Decimal('0 0')}, "'0 0'");
303023dd3b8Sopenharmony_ci});
304