9 # Silence the deprecation warnings from bigfloat.pl for the purpose
10 # of testing. These tests will be removed along with bigfloat.pl in
11 # the next major release of perl.
12 local $SIG{__WARN__} = sub {
13 if ($_[0] !~ /deprecated/) {
17 require "bigfloat.pl";
31 @args = split(/:/,$_,99);
33 $try = "$f('" . join("','", @args) . "');";
34 if (($ans1 = eval($try)) eq $ans) {
37 print "not ok $test\n";
38 print "# '$try' expected: '$ans' got: '$ans1'\n";
54 000000 0000000 00000:+0E+0
61 123456789:+123456789E+0
65 -123456789:-123456789E+0
86 +123456789:-123456789E+0
87 -123456789:+123456789E+0
88 +123.456789:-123456789E-6
89 -123456.789:+123456789E-3
95 +123456789:+123456789E+0
96 -123456789:+123456789E+0
97 +123.456789:+123456789E-6
98 -123456.789:+123456789E-3
100 $bigfloat::rnd_mode = 'trunc'
101 +10123456789:5:+10123E+6
102 -10123456789:5:-10123E+6
103 +10123456789:9:+101234567E+2
104 -10123456789:9:-101234567E+2
105 +101234500:6:+101234E+3
106 -101234500:6:-101234E+3
107 $bigfloat::rnd_mode = 'zero'
108 +20123456789:5:+20123E+6
109 -20123456789:5:-20123E+6
110 +20123456789:9:+201234568E+2
111 -20123456789:9:-201234568E+2
112 +201234500:6:+201234E+3
113 -201234500:6:-201234E+3
114 $bigfloat::rnd_mode = '+inf'
115 +30123456789:5:+30123E+6
116 -30123456789:5:-30123E+6
117 +30123456789:9:+301234568E+2
118 -30123456789:9:-301234568E+2
119 +301234500:6:+301235E+3
120 -301234500:6:-301234E+3
121 $bigfloat::rnd_mode = '-inf'
122 +40123456789:5:+40123E+6
123 -40123456789:5:-40123E+6
124 +40123456789:9:+401234568E+2
125 -40123456789:9:-401234568E+2
126 +401234500:6:+401234E+3
127 -401234500:6:-401235E+3
128 $bigfloat::rnd_mode = 'odd'
129 +50123456789:5:+50123E+6
130 -50123456789:5:-50123E+6
131 +50123456789:9:+501234568E+2
132 -50123456789:9:-501234568E+2
133 +501234500:6:+501235E+3
134 -501234500:6:-501235E+3
135 $bigfloat::rnd_mode = 'even'
136 +60123456789:5:+60123E+6
137 -60123456789:5:-60123E+6
138 +60123456789:9:+601234568E+2
139 -60123456789:9:-601234568E+2
140 +601234500:6:+601234E+3
141 -601234500:6:-601234E+3
143 $bigfloat::rnd_mode = 'trunc'
154 $bigfloat::rnd_mode = 'zero'
168 $bigfloat::rnd_mode = '+inf'
182 $bigfloat::rnd_mode = '-inf'
196 $bigfloat::rnd_mode = 'odd'
210 $bigfloat::rnd_mode = 'even'
269 +9999999999:+1:+1E+10
270 +99999999999:+1:+1E+11
276 +1000000:-1:+999999E+0
277 +10000000:-1:+9999999E+0
278 +100000000:-1:+99999999E+0
279 +1000000000:-1:+999999999E+0
280 +10000000000:-1:+9999999999E+0
281 +123456789:+987654321:+111111111E+1
282 -123456789:+987654321:+864197532E+0
283 -123456789:-987654321:-111111111E+1
284 +123456789:-987654321:-864197532E+0
303 +999999:+1:+999998E+0
304 +9999999:+1:+9999998E+0
305 +99999999:+1:+99999998E+0
306 +999999999:+1:+999999998E+0
307 +9999999999:+1:+9999999998E+0
308 +99999999999:+1:+99999999998E+0
313 +100000:-1:+100001E+0
314 +1000000:-1:+1000001E+0
315 +10000000:-1:+10000001E+0
316 +100000000:-1:+100000001E+0
317 +1000000000:-1:+1000000001E+0
318 +10000000000:-1:+10000000001E+0
319 +123456789:+987654321:-864197532E+0
320 -123456789:+987654321:-111111111E+1
321 -123456789:-987654321:+864197532E+0
322 +123456789:-987654321:+111111111E+1
332 +123456789123456789:+0:+0E+0
333 +0:+123456789123456789:+0E+0
343 +10101:+10101:+102030201E+0
344 +1001001:+1001001:+1002003002001E+0
345 +100010001:+100010001:+10002000300020001E+0
346 +10000100001:+10000100001:+100002000030000200001E+0
347 +11111111111:+9:+99999999999E+0
348 +22222222222:+9:+199999999998E+0
349 +33333333333:+9:+299999999997E+0
350 +44444444444:+9:+399999999996E+0
351 +55555555555:+9:+499999999995E+0
352 +66666666666:+9:+599999999994E+0
353 +77777777777:+9:+699999999993E+0
354 +88888888888:+9:+799999999992E+0
355 +99999999999:+9:+899999999991E+0
376 +999999999999:+9:+111111111111E+0
377 +999999999999:+99:+10101010101E+0
378 +999999999999:+999:+1001001001E+0
379 +999999999999:+9999:+100010001E+0
380 +999999999999999:+99999:+10000100001E+0
381 +1000000000:+9:+1111111111111111111111111111111111111111E-31
382 +2000000000:+9:+2222222222222222222222222222222222222222E-31
383 +3000000000:+9:+3333333333333333333333333333333333333333E-31
384 +4000000000:+9:+4444444444444444444444444444444444444444E-31
385 +5000000000:+9:+5555555555555555555555555555555555555556E-31
386 +6000000000:+9:+6666666666666666666666666666666666666667E-31
387 +7000000000:+9:+7777777777777777777777777777777777777778E-31
388 +8000000000:+9:+8888888888888888888888888888888888888889E-31
390 +35500000:+113:+3141592920353982300884955752212389380531E-34
391 +71000000:+226:+3141592920353982300884955752212389380531E-34
392 +106500000:+339:+3141592920353982300884955752212389380531E-34
393 +1000000000:+3:+3333333333333333333333333333333333333333E-31
394 $bigfloat::div_scale = 20
395 +1000000000:+9:+11111111111111111111E-11
396 +2000000000:+9:+22222222222222222222E-11
397 +3000000000:+9:+33333333333333333333E-11
398 +4000000000:+9:+44444444444444444444E-11
399 +5000000000:+9:+55555555555555555556E-11
400 +6000000000:+9:+66666666666666666667E-11
401 +7000000000:+9:+77777777777777777778E-11
402 +8000000000:+9:+88888888888888888889E-11
404 +35500000:+113:+314159292035398230088E-15
405 +71000000:+226:+314159292035398230088E-15
406 +106500000:+339:+31415929203539823009E-14
407 +1000000000:+3:+33333333333333333333E-11
408 $bigfloat::div_scale = 40
417 +2:+141421356237309504880168872420969807857E-38
421 +123.456:+1111107555549866648462149404118219234119E-38
422 +15241.383936:+123456E-3