21 @args = split(/:/,$_,99);
23 $try = "\$x = new Math::BigFloat \"$args[0]\";";
26 } elsif ($f eq "fneg") {
28 } elsif ($f eq "fabs") {
30 } elsif ($f eq "fround") {
31 $try .= "0+\$x->fround($args[1]);";
32 } elsif ($f eq "ffround") {
33 $try .= "0+\$x->ffround($args[1]);";
34 } elsif ($f eq "fsqrt") {
35 $try .= "0+\$x->fsqrt;";
37 $try .= "\$y = new Math::BigFloat \"$args[1]\";";
39 $try .= "\$x <=> \$y;";
48 } else { warn "Unknown op"; }
50 #print ">>>",$try,"<<<\n";
52 if ("$ans1" eq $ans) { #bug!
55 print "not ok $test\n";
56 print "# '$try' expected: '$ans' got: '$ans1'\n";
72 000000 0000000 00000:0.
83 -123456789:-123456789.
90 -.0000000004:-.0000000004
97 -3e111:-3000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.
98 -4e-1111:-.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004
104 +123456789:-123456789.
105 -123456789:123456789.
106 +123.456789:-123.456789
107 -123456.789:123456.789
113 +123456789:123456789.
114 -123456789:123456789.
115 +123.456789:123.456789
116 -123456.789:123456.789
118 $Math::BigFloat::rnd_mode = 'trunc'
119 +10123456789:5:10123000000
120 -10123456789:5:-10123000000
121 +10123456789:9:10123456700
122 -10123456789:9:-10123456700
123 +101234500:6:101234000
124 -101234500:6:-101234000
125 $Math::BigFloat::rnd_mode = 'zero'
126 +20123456789:5:20123000000
127 -20123456789:5:-20123000000
128 +20123456789:9:20123456800
129 -20123456789:9:-20123456800
130 +201234500:6:201234000
131 -201234500:6:-201234000
132 $Math::BigFloat::rnd_mode = '+inf'
133 +30123456789:5:30123000000
134 -30123456789:5:-30123000000
135 +30123456789:9:30123456800
136 -30123456789:9:-30123456800
137 +301234500:6:301235000
138 -301234500:6:-301234000
139 $Math::BigFloat::rnd_mode = '-inf'
140 +40123456789:5:40123000000
141 -40123456789:5:-40123000000
142 +40123456789:9:40123456800
143 -40123456789:9:-40123456800
144 +401234500:6:401234000
145 -401234500:6:-401235000
146 $Math::BigFloat::rnd_mode = 'odd'
147 +50123456789:5:50123000000
148 -50123456789:5:-50123000000
149 +50123456789:9:50123456800
150 -50123456789:9:-50123456800
151 +501234500:6:501235000
152 -501234500:6:-501235000
153 $Math::BigFloat::rnd_mode = 'even'
154 +60123456789:5:60123000000
155 -60123456789:5:-60123000000
156 +60123456789:9:60123456800
157 -60123456789:9:-60123456800
158 +601234500:6:601234000
159 -601234500:6:-601234000
161 $Math::BigFloat::rnd_mode = 'trunc'
175 $Math::BigFloat::rnd_mode = 'zero'
189 $Math::BigFloat::rnd_mode = '+inf'
203 $Math::BigFloat::rnd_mode = '-inf'
217 $Math::BigFloat::rnd_mode = 'odd'
231 $Math::BigFloat::rnd_mode = 'even'
287 +9999999:+1:10000000.
288 +99999999:+1:100000000.
289 +999999999:+1:1000000000.
290 +9999999999:+1:10000000000.
291 +99999999999:+1:100000000000.
298 +10000000:-1:9999999.
299 +100000000:-1:99999999.
300 +1000000000:-1:999999999.
301 +10000000000:-1:9999999999.
302 +123456789:+987654321:1111111110.
303 -123456789:+987654321:864197532.
304 -123456789:-987654321:-1111111110.
305 +123456789:-987654321:-864197532.
326 +99999999:+1:99999998.
327 +999999999:+1:999999998.
328 +9999999999:+1:9999999998.
329 +99999999999:+1:99999999998.
336 +10000000:-1:10000001.
337 +100000000:-1:100000001.
338 +1000000000:-1:1000000001.
339 +10000000000:-1:10000000001.
340 +123456789:+987654321:-864197532.
341 -123456789:+987654321:-1111111110.
342 -123456789:-987654321:864197532.
343 +123456789:-987654321:1111111110.
353 +123456789123456789:+0:0.
354 +0:+123456789123456789:0.
364 +10101:+10101:102030201.
365 +1001001:+1001001:1002003002001.
366 +100010001:+100010001:10002000300020001.
367 +10000100001:+10000100001:100002000030000200001.
368 +11111111111:+9:99999999999.
369 +22222222222:+9:199999999998.
370 +33333333333:+9:299999999997.
371 +44444444444:+9:399999999996.
372 +55555555555:+9:499999999995.
373 +66666666666:+9:599999999994.
374 +77777777777:+9:699999999993.
375 +88888888888:+9:799999999992.
376 +99999999999:+9:899999999991.
397 +999999999999:+9:111111111111.
398 +999999999999:+99:10101010101.
399 +999999999999:+999:1001001001.
400 +999999999999:+9999:100010001.
401 +999999999999999:+99999:10000100001.
402 +1000000000:+9:111111111.1111111111111111111111111111111
403 +2000000000:+9:222222222.2222222222222222222222222222222
404 +3000000000:+9:333333333.3333333333333333333333333333333
405 +4000000000:+9:444444444.4444444444444444444444444444444
406 +5000000000:+9:555555555.5555555555555555555555555555556
407 +6000000000:+9:666666666.6666666666666666666666666666667
408 +7000000000:+9:777777777.7777777777777777777777777777778
409 +8000000000:+9:888888888.8888888888888888888888888888889
410 +9000000000:+9:1000000000.
411 +35500000:+113:314159.2920353982300884955752212389380531
412 +71000000:+226:314159.2920353982300884955752212389380531
413 +106500000:+339:314159.2920353982300884955752212389380531
414 +1000000000:+3:333333333.3333333333333333333333333333333
415 $Math::BigFloat::div_scale = 20
416 +1000000000:+9:111111111.11111111111
417 +2000000000:+9:222222222.22222222222
418 +3000000000:+9:333333333.33333333333
419 +4000000000:+9:444444444.44444444444
420 +5000000000:+9:555555555.55555555556
421 +6000000000:+9:666666666.66666666667
422 +7000000000:+9:777777777.77777777778
423 +8000000000:+9:888888888.88888888889
424 +9000000000:+9:1000000000.
425 +35500000:+113:314159.292035398230088
426 +71000000:+226:314159.292035398230088
427 +106500000:+339:314159.29203539823009
428 +1000000000:+3:333333333.33333333333
429 $Math::BigFloat::div_scale = 40
438 +2:1.41421356237309504880168872420969807857
442 +123.456:11.11107555549866648462149404118219234119
443 +15241.383936:123.456