1 #include this file into another test for subclass testing...
3 ok ($class->config()->{lib},$CL);
12 $_ =~ s/#.*$//; # remove comments
13 $_ =~ s/\s+$//; # trailing spaces
14 next if /^$/; # skip empty lines & comments
21 $setup = $_; $setup =~ s/\$/\$${class}::/g; # round_mode, div_scale
22 #print "\$setup== $setup\n";
29 @args = split(/:/,$1,99);
33 @args = split(/:/,$_,99); $ans = pop(@args);
35 $try = "\$x = $class->new(\"$args[0]\");";
39 } elsif ($f eq "finf") {
40 $try .= "\$x->finf('$args[1]');";
41 } elsif ($f eq "is_inf") {
42 $try .= "\$x->is_inf('$args[1]');";
43 } elsif ($f eq "fone") {
44 $try .= "\$x->bone('$args[1]');";
45 } elsif ($f eq "fstr") {
46 $try .= "\$x->accuracy($args[1]); \$x->precision($args[2]);";
47 $try .= '$x->fstr();';
48 } elsif ($f eq "parts") {
49 # ->bstr() to see if an object is returned
50 $try .= '($a,$b) = $x->parts(); $a = $a->bstr(); $b = $b->bstr();';
52 } elsif ($f eq "exponent") {
53 # ->bstr() to see if an object is returned
54 $try .= '$x->exponent()->bstr();';
55 } elsif ($f eq "mantissa") {
56 # ->bstr() to see if an object is returned
57 $try .= '$x->mantissa()->bstr();';
58 } elsif ($f =~ /^(numify|length|as_number|as_hex|as_bin)$/) {
60 # some unary ops (test the fxxx form, since that is done by AUTOLOAD)
61 } elsif ($f =~ /^f(nan|sstr|neg|floor|ceil|abs)$/) {
62 $try .= "\$x->f$1();";
63 # some is_xxx test function
64 } elsif ($f =~ /^is_(zero|one|negative|positive|odd|even|nan|int)$/) {
66 } elsif ($f eq "finc") {
68 } elsif ($f eq "fdec") {
70 }elsif ($f eq "fround") {
71 $try .= "$setup; \$x->fround($args[1]);";
72 } elsif ($f eq "ffround") {
73 $try .= "$setup; \$x->ffround($args[1]);";
74 } elsif ($f eq "fsqrt") {
75 $try .= "$setup; \$x->fsqrt();";
76 } elsif ($f eq "ffac") {
77 $try .= "$setup; \$x->ffac();";
78 } elsif ($f eq "flog") {
79 if (defined $args[1] && $args[1] ne '')
81 $try .= "\$y = $class->new($args[1]);";
82 $try .= "$setup; \$x->flog(\$y);";
86 $try .= "$setup; \$x->flog();";
91 $try .= "\$y = $class->new(\"$args[1]\");";
97 $try .= " \$z = $class->new(\"$args[2]\"); ";
99 $try .= "$class\::bgcd(\$x, \$y";
100 $try .= ", \$z" if (defined $args[2]);
105 if (defined $args[2])
107 $try .= " \$z = $class->new(\"$args[2]\"); ";
109 $try .= "$class\::blcm(\$x, \$y";
110 $try .= ", \$z" if (defined $args[2]);
112 } elsif ($f eq "fcmp") {
113 $try .= '$x->fcmp($y);';
114 } elsif ($f eq "facmp") {
115 $try .= '$x->facmp($y);';
116 } elsif ($f eq "fpow") {
118 } elsif ($f eq "froot") {
119 $try .= "$setup; \$x->froot(\$y);";
120 } elsif ($f eq "fadd") {
122 } elsif ($f eq "fsub") {
124 } elsif ($f eq "fmul") {
126 } elsif ($f eq "fdiv") {
127 $try .= "$setup; \$x / \$y;";
128 } elsif ($f eq "fdiv-list") {
129 $try .= "$setup; join(',',\$x->fdiv(\$y));";
130 } elsif ($f eq "frsft") {
132 } elsif ($f eq "flsft") {
134 } elsif ($f eq "fmod") {
136 } else { warn "Unknown op '$f'"; }
138 # print "# Trying: '$try'\n";
140 print "# Error: $@\n" if $@;
141 if ($ans =~ m|^/(.*)$|)
150 print "# '$try' expected: /$pat/ got: '$ans1'\n" if !ok(1,0);
161 print "# Tried: '$try'\n" if !ok ($ans1, $ans);
162 if (ref($ans1) eq "$class")
164 # float numbers are normalized (for now), so mantissa shouldn't have
166 #print $ans1->_trailing_zeros(),"\n";
167 print "# Has trailing zeros after '$try'\n"
168 if !ok ($CL->_zeros( $ans1->{_m}), 0);
171 } # end pattern or string
175 # check whether $class->new( Math::BigInt->new()) destroys it
176 # ($y == 12 in this case)
177 $x = Math::BigInt->new(1200); $y = $class->new($x);
178 ok ($y,1200); ok ($x,1200);
180 ###############################################################################
181 # Really huge, big, ultra-mega-biggy-monster exponents
182 # Technically, the exponents should not be limited (they are BigInts), but
183 # practically there are a few places were they are limited to a Perl scalar.
184 # This is sometimes for speed, sometimes because otherwise the number wouldn't
185 # fit into your memory (just think of 1e123456789012345678901234567890 + 1!)
186 # anyway. We don't test everything here, but let's make sure it just basically
189 my $monster = '1e1234567890123456789012345678901234567890';
192 ok ($class->new($monster)->bsstr(),
193 '1e+1234567890123456789012345678901234567890');
194 ok ($class->new($monster)->exponent(),
195 '1234567890123456789012345678901234567890');
197 ok ($class->new($monster) > 0,1);
200 ok ($class->new($monster)->bsub( $monster),0);
201 ok ($class->new($monster)->bmul(2)->bsstr(),
202 '2e+1234567890123456789012345678901234567890');
205 $monster = '1234567890123456789012345678901234567890e2';
206 ok ($class->new($monster)->mantissa(),
207 '123456789012345678901234567890123456789');
209 ###############################################################################
212 $x = $class->new(2); $x->fzero(); ok_undef ($x->{_a}); ok_undef ($x->{_p});
213 $x = $class->new(2); $x->finf(); ok_undef ($x->{_a}); ok_undef ($x->{_p});
214 $x = $class->new(2); $x->fone(); ok_undef ($x->{_a}); ok_undef ($x->{_p});
215 $x = $class->new(2); $x->fnan(); ok_undef ($x->{_a}); ok_undef ($x->{_p});
217 ###############################################################################
218 # bone/binf etc as plain calls (Lite failed them)
220 ok ($class->fzero(),0);
221 ok ($class->fone(),1);
222 ok ($class->fone('+'),1);
223 ok ($class->fone('-'),-1);
224 ok ($class->fnan(),'NaN');
225 ok ($class->finf(),'inf');
226 ok ($class->finf('+'),'inf');
227 ok ($class->finf('-'),'-inf');
228 ok ($class->finf('-inf'),'-inf');
230 $class->accuracy(undef); $class->precision(undef); # reset
232 ###############################################################################
233 # bug in bsstr()/numify() showed up in after-rounding in bdiv()
235 $x = $class->new('0.008'); $y = $class->new(2);
239 ###############################################################################
240 # fsqrt() with set global A/P or A/P enabled on $x, also a test whether fsqrt()
241 # correctly modifies $x
244 $x = $class->new(12); $class->precision(-2); $x->fsqrt(); ok ($x,'3.46');
246 $class->precision(undef);
247 $x = $class->new(12); $class->precision(0); $x->fsqrt(); ok ($x,'3');
249 $class->precision(-3); $x = $class->new(12); $x->fsqrt(); ok ($x,'3.464');
254 ${${class}.'::accuracy'} = 4; $x = $class->new(12);
255 $x->fsqrt(3); ok ($x,'NaN');
256 # supplied arg overrides set global
257 $class->precision(undef); $x = $class->new(12); $x->fsqrt(3); ok ($x,'3.46');
258 $class->accuracy(undef); $class->precision(undef); # reset for further tests
261 #############################################################################
262 # can we call objectify (broken until v1.52)
267 '@args' . " = $class" . "::objectify(2,$class,4,5);".'join(" ",@args);';
269 ok ($ans,"$class 4 5");
272 #############################################################################
273 # is_one('-') (broken until v1.64)
275 ok ($class->new(-1)->is_one(),0);
276 ok ($class->new(-1)->is_one('-'),1);
278 #############################################################################
279 # bug 1/0.5 leaving 2e-0 instead of 2e0
281 ok ($class->new(1)->fdiv('0.5')->bsstr(),'2e+0');
283 ###############################################################################
284 # [perl #30609] bug with $x -= $x not beeing 0, but 2*$x
286 $x = $class->new(3); $x -= $x; ok ($x, 0);
287 $x = $class->new(-3); $x -= $x; ok ($x, 0);
288 $x = $class->new(3); $x += $x; ok ($x, 6);
289 $x = $class->new(-3); $x += $x; ok ($x, -6);
291 $x = $class->new('NaN'); $x -= $x; ok ($x->is_nan(), 1);
292 $x = $class->new('inf'); $x -= $x; ok ($x->is_nan(), 1);
293 $x = $class->new('-inf'); $x -= $x; ok ($x->is_nan(), 1);
295 $x = $class->new('NaN'); $x += $x; ok ($x->is_nan(), 1);
296 $x = $class->new('inf'); $x += $x; ok ($x->is_inf(), 1);
297 $x = $class->new('-inf'); $x += $x; ok ($x->is_inf('-'), 1);
299 $x = $class->new('3.14'); $x -= $x; ok ($x, 0);
300 $x = $class->new('-3.14'); $x -= $x; ok ($x, 0);
301 $x = $class->new('3.14'); $x += $x; ok ($x, '6.28');
302 $x = $class->new('-3.14'); $x += $x; ok ($x, '-6.28');
304 $x = $class->new('3.14'); $x *= $x; ok ($x, '9.8596');
305 $x = $class->new('-3.14'); $x *= $x; ok ($x, '9.8596');
306 $x = $class->new('3.14'); $x /= $x; ok ($x, '1');
307 $x = $class->new('-3.14'); $x /= $x; ok ($x, '1');
308 $x = $class->new('3.14'); $x %= $x; ok ($x, '0');
309 $x = $class->new('-3.14'); $x %= $x; ok ($x, '0');
311 ###############################################################################
312 # the following two were reported by "kenny" via hotmail.com:
314 #perl -MMath::BigFloat -wle 'print Math::BigFloat->new(0)->bpow(".1")'
315 #Use of uninitialized value in numeric le (<=) at BigFloat.pm line 1851.
317 $x = $class->new(0); $y = $class->new('0.1');
318 ok ($x ** $y, 0, 'no warnings and zero result');
320 #perl -MMath::BigFloat -lwe 'print Math::BigFloat->new(".222222222222222222222222222222222222222222")->bceil()'
321 #Use of uninitialized value in numeric le (<=) at BigFloat.pm line 1851.
323 $x = $class->new(".222222222222222222222222222222222222222222");
324 ok ($x->bceil(), 1, 'no warnings and one as result');
326 ###############################################################################
330 $x = $class->new(2); $x **= 148; $x++; $x->bdiv(17, 60)->bfloor(); $x->accuracy(undef);
331 ok ($x,"20988936657440586486151264256610222593863921");
332 ok ($x->length(),length "20988936657440586486151264256610222593863921");
334 $x = $class->new('2');
335 my $y = $class->new('18');
336 ok ($x <<= $y, 2 << 18);
341 $x = $class->new('2');
342 $y = $class->new('18.2');
343 $x <<= $y; # 2 * (2 ** 18.2);
345 ok ($x->copy()->bfround(-9), '602248.763144685');
346 ok ($x >>= $y, 2); # 2 * (2 ** 18.2) / (2 ** 18.2) => 2
351 ###############################################################################
352 # Perl 5.005 does not like ok ($x,undef)
358 ok (1,1) and return if !defined $x;
404 # base > 0, base != 1
408 # log(1) is always 1, regardless of $base
412 2::0.6931471805599453094172321214581765680755
413 2.718281828::0.9999999998311266953289851340574956564911
415 2.718281828::0.99999999983112669533
417 123::4.81218435537242
419 1000::6.90775527898214
420 100::4.60517018598809
422 3.1415::1.14470039286086
423 12345::9.42100640177928
424 0.001::-6.90775527898214
428 # reset for further tests
463 # some inputs that result in zero
497 # test for bug in brsft() not handling cases that return 0
542 # uses bsstr() so 5 => 5e+0 to be compatible w/ Perls output
579 1234.567:9::1234.56700
580 1234.567::-6:1234.567000
582 0.001234:6::0.00123400
583 0.001234::-8:0.00123400
606 000000_0000000_00000:0
617 -123456789:-123456789
625 -.0000000004:-0.0000000004
640 -3e111:-3000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
641 -4e-1111:-0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004
660 123.456:2:15241.383936
663 128:-2:0.00006103515625
678 # 2 ** 0.5 == sqrt(2)
679 # 1.41..7 and not 1.4170 since fallback (bsqrt(9) is '3', not 3.0...0)
680 2:0.5:1.41421356237309504880168872420969807857
681 #2:0.2:1.148698354997035006798626946777927589444
682 #6:1.5:14.6969384566990685891837044482353483518
684 #62.5:12.5:26447206647554886213592.3959144
693 +123456789:-123456789
695 +123.456789:-123.456789
696 -123456.789:123456.789
706 +123.456789:123.456789
707 -123456.789:123456.789
709 $round_mode = "trunc"
714 +10123456789:5:10123000000
715 -10123456789:5:-10123000000
716 +10123456789.123:5:10123000000
717 -10123456789.123:5:-10123000000
718 +10123456789:9:10123456700
719 -10123456789:9:-10123456700
720 +101234500:6:101234000
721 -101234500:6:-101234000
723 +20123456789:5:20123000000
724 -20123456789:5:-20123000000
725 +20123456789.123:5:20123000000
726 -20123456789.123:5:-20123000000
727 +20123456789:9:20123456800
728 -20123456789:9:-20123456800
729 +201234500:6:201234000
730 -201234500:6:-201234000
732 +30123456789:5:30123000000
733 -30123456789:5:-30123000000
734 +30123456789.123:5:30123000000
735 -30123456789.123:5:-30123000000
736 +30123456789:9:30123456800
737 -30123456789:9:-30123456800
738 +301234500:6:301235000
739 -301234500:6:-301234000
741 +40123456789:5:40123000000
742 -40123456789:5:-40123000000
743 +40123456789.123:5:40123000000
744 -40123456789.123:5:-40123000000
745 +40123456789:9:40123456800
746 -40123456789:9:-40123456800
747 +401234500:6:401234000
748 -401234500:6:-401235000
750 +50123456789:5:50123000000
751 -50123456789:5:-50123000000
752 +50123456789.123:5:50123000000
753 -50123456789.123:5:-50123000000
754 +50123456789:9:50123456800
755 -50123456789:9:-50123456800
756 +501234500:6:501235000
757 -501234500:6:-501235000
759 +60123456789:5:60123000000
760 -60123456789:5:-60123000000
761 +60123456789:9:60123456800
762 -60123456789:9:-60123456800
763 +601234500:6:601234000
764 -601234500:6:-601234000
765 +60123456789.0123:5:60123000000
766 -60123456789.0123:5:-60123000000
767 $round_mode = "common"
768 +60123456789:5:60123000000
769 -60123456789:5:-60123000000
770 +60123456789:6:60123500000
771 -60123456789:6:-60123500000
772 +60123456789:9:60123456800
773 -60123456789:9:-60123456800
774 +601234500:6:601235000
775 -601234500:6:-601235000
776 +601234400:6:601234000
777 -601234400:6:-601234000
778 +601234600:6:601235000
779 -601234600:6:-601235000
780 +601234300:6:601234000
781 +60123456789.0123:5:60123000000
782 -60123456789.0123:5:-60123000000
784 $round_mode = "trunc"
805 -0.0061234567890:-1:0.0
813 -0.0065:-3:/-0\.006|-6e-03
814 -0.0065:-4:/-0\.006(?:5|49{5}\d+)|-6\.5e-03
815 -0.0065:-5:/-0\.006(?:5|49{5}\d+)|-6\.5e-03
821 +2.23:-1:/2.2(?:0{5}\d+)?
822 -2.23:-1:/-2.2(?:0{5}\d+)?
823 +2.27:-1:/2.(?:3|29{5}\d+)
824 -2.27:-1:/-2.(?:3|29{5}\d+)
825 +2.25:-1:/2.2(?:0{5}\d+)?
826 -2.25:-1:/-2.2(?:0{5}\d+)?
827 +2.35:-1:/2.(?:3|29{5}\d+)
828 -2.35:-1:/-2.(?:3|29{5}\d+)
830 -0.0065:-2:/-0\.01|-1e-02
831 -0.0065:-3:/-0\.006|-6e-03
832 -0.0065:-4:/-0\.006(?:5|49{5}\d+)|-6\.5e-03
833 -0.0065:-5:/-0\.006(?:5|49{5}\d+)|-6\.5e-03
839 +3.23:-1:/3.2(?:0{5}\d+)?
840 -3.23:-1:/-3.2(?:0{5}\d+)?
841 +3.27:-1:/3.(?:3|29{5}\d+)
842 -3.27:-1:/-3.(?:3|29{5}\d+)
843 +3.25:-1:/3.(?:3|29{5}\d+)
844 -3.25:-1:/-3.2(?:0{5}\d+)?
845 +3.35:-1:/3.(?:4|39{5}\d+)
846 -3.35:-1:/-3.(?:3|29{5}\d+)
848 -0.0065:-2:/-0\.01|-1e-02
849 -0.0065:-3:/-0\.006|-6e-03
850 -0.0065:-4:/-0\.006(?:5|49{5}\d+)|-6\.5e-03
851 -0.0065:-5:/-0\.006(?:5|49{5}\d+)|-6\.5e-03
857 +4.23:-1:/4.2(?:0{5}\d+)?
858 -4.23:-1:/-4.2(?:0{5}\d+)?
859 +4.27:-1:/4.(?:3|29{5}\d+)
860 -4.27:-1:/-4.(?:3|29{5}\d+)
861 +4.25:-1:/4.2(?:0{5}\d+)?
862 -4.25:-1:/-4.(?:3|29{5}\d+)
863 +4.35:-1:/4.(?:3|29{5}\d+)
864 -4.35:-1:/-4.(?:4|39{5}\d+)
866 -0.0065:-2:/-0\.01|-1e-02
867 -0.0065:-3:/-0\.007|-7e-03
868 -0.0065:-4:/-0\.006(?:5|49{5}\d+)|-6\.5e-03
869 -0.0065:-5:/-0\.006(?:5|49{5}\d+)|-6\.5e-03
875 +5.23:-1:/5.2(?:0{5}\d+)?
876 -5.23:-1:/-5.2(?:0{5}\d+)?
877 +5.27:-1:/5.(?:3|29{5}\d+)
878 -5.27:-1:/-5.(?:3|29{5}\d+)
879 +5.25:-1:/5.(?:3|29{5}\d+)
880 -5.25:-1:/-5.(?:3|29{5}\d+)
881 +5.35:-1:/5.(?:3|29{5}\d+)
882 -5.35:-1:/-5.(?:3|29{5}\d+)
884 -0.0065:-2:/-0\.01|-1e-02
885 -0.0065:-3:/-0\.007|-7e-03
886 -0.0065:-4:/-0\.006(?:5|49{5}\d+)|-6\.5e-03
887 -0.0065:-5:/-0\.006(?:5|49{5}\d+)|-6\.5e-03
893 +6.23:-1:/6.2(?:0{5}\d+)?
894 -6.23:-1:/-6.2(?:0{5}\d+)?
895 +6.27:-1:/6.(?:3|29{5}\d+)
896 -6.27:-1:/-6.(?:3|29{5}\d+)
897 +6.25:-1:/6.(?:2(?:0{5}\d+)?|29{5}\d+)
898 -6.25:-1:/-6.(?:2(?:0{5}\d+)?|29{5}\d+)
899 +6.35:-1:/6.(?:4|39{5}\d+|29{8}\d+)
900 -6.35:-1:/-6.(?:4|39{5}\d+|29{8}\d+)
902 -0.0065:-2:/-0\.01|-1e-02
903 -0.0065:-3:/-0\.006|-7e-03
904 -0.0065:-4:/-0\.006(?:5|49{5}\d+)|-6\.5e-03
905 -0.0065:-5:/-0\.006(?:5|49{5}\d+)|-6\.5e-03
912 0.01234567:-5:0.01235
913 0.01234567:-6:0.012346
914 0.01234567:-7:0.0123457
915 0.01234567:-8:0.01234567
916 0.01234567:-9:0.012345670
917 0.01234567:-12:0.012345670000
1032 0.00000123:0.0005:-1
1118 +9999999:+1:10000000
1119 +99999999:+1:100000000
1120 +999999999:+1:1000000000
1121 +9999999999:+1:10000000000
1122 +99999999999:+1:100000000000
1129 +10000000:-1:9999999
1130 +100000000:-1:99999999
1131 +1000000000:-1:999999999
1132 +10000000000:-1:9999999999
1133 +123456789:+987654321:1111111110
1134 -123456789:+987654321:864197532
1135 -123456789:-987654321:-1111111110
1136 +123456789:-987654321:-864197532
1137 0.001234:0.0001234:0.0013574
1166 +99999999:+1:99999998
1167 +999999999:+1:999999998
1168 +9999999999:+1:9999999998
1169 +99999999999:+1:99999999998
1176 +10000000:-1:10000001
1177 +100000000:-1:100000001
1178 +1000000000:-1:1000000001
1179 +10000000000:-1:10000000001
1180 +123456789:+987654321:-864197532
1181 -123456789:+987654321:-1111111110
1182 -123456789:-987654321:864197532
1183 +123456789:-987654321:1111111110
1209 +123456789123456789:+0:0
1210 +0:+123456789123456789:0
1220 +10101:+10101:102030201
1221 +1001001:+1001001:1002003002001
1222 +100010001:+100010001:10002000300020001
1223 +10000100001:+10000100001:100002000030000200001
1224 +11111111111:+9:99999999999
1225 +22222222222:+9:199999999998
1226 +33333333333:+9:299999999997
1227 +44444444444:+9:399999999996
1228 +55555555555:+9:499999999995
1229 +66666666666:+9:599999999994
1230 +77777777777:+9:699999999993
1231 +88888888888:+9:799999999992
1232 +99999999999:+9:899999999991
1240 # bug in v1.74 with bdiv in list context, when $y is 1 or -1
1246 $div_scale = 40; $round_mode = 'even'
1272 +999999999999:+9:111111111111
1273 +999999999999:+99:10101010101
1274 +999999999999:+999:1001001001
1275 +999999999999:+9999:100010001
1276 +999999999999999:+99999:10000100001
1277 +1000000000:+9:111111111.1111111111111111111111111111111
1278 +2000000000:+9:222222222.2222222222222222222222222222222
1279 +3000000000:+9:333333333.3333333333333333333333333333333
1280 +4000000000:+9:444444444.4444444444444444444444444444444
1281 +5000000000:+9:555555555.5555555555555555555555555555556
1282 +6000000000:+9:666666666.6666666666666666666666666666667
1283 +7000000000:+9:777777777.7777777777777777777777777777778
1284 +8000000000:+9:888888888.8888888888888888888888888888889
1285 +9000000000:+9:1000000000
1286 +35500000:+113:314159.2920353982300884955752212389380531
1287 +71000000:+226:314159.2920353982300884955752212389380531
1288 +106500000:+339:314159.2920353982300884955752212389380531
1289 +1000000000:+3:333333333.3333333333333333333333333333333
1290 2:25.024996000799840031993601279744051189762:0.07992009269196593320152084692285869265447
1293 +1000000000:+9:111111111.11111111111
1294 +2000000000:+9:222222222.22222222222
1295 +3000000000:+9:333333333.33333333333
1296 +4000000000:+9:444444444.44444444444
1297 +5000000000:+9:555555555.55555555556
1298 +6000000000:+9:666666666.66666666667
1299 +7000000000:+9:777777777.77777777778
1300 +8000000000:+9:888888888.88888888889
1301 +9000000000:+9:1000000000
1306 1:504:0.001984126984126984127
1307 2:1.987654321:1.0062111801179738436
1308 123456789.123456789123456789123456789:1:123456789.12345678912
1309 # the next two cases are the "old" behaviour, but are now (>v0.01) different
1310 #+35500000:+113:314159.292035398230088
1311 #+71000000:+226:314159.292035398230088
1312 +35500000:+113:314159.29203539823009
1313 +71000000:+226:314159.29203539823009
1314 +106500000:+339:314159.29203539823009
1315 +1000000000:+3:333333333.33333333333
1317 # round to accuracy 1 after bdiv
1319 123456789.1234:1:100000000
1320 # reset scale for further tests
1327 # inf handling, see table in doc
1346 # exceptions to reminder rule
1385 999999999999999:99999:0
1399 152403346:12345:4321
1401 # now some floating point tests
1434 # -$x ** (1/2) => -$y, but not in froot()
1438 2:2:1.41421356237309504880168872420969807857
1444 123.456:2:11.11107555549866648462149404118219234119
1445 15241.38393:2:123.4559999756998444766131352122991626468
1447 12:2:3.464101615137754587054892683011744733886
1478 # see t/bigroot() for more tests
1489 2:1.41421356237309504880168872420969807857
1494 123.456:11.11107555549866648462149404118219234119
1495 15241.38393:123.4559999756998444766131352122991626468
1497 # sqrt(1.44) = 1.2, sqrt(e10) = e5 => 12e4
1499 2e10:141421.356237309504880168872420969807857
1501 # proved to be an endless loop under 7-9
1502 12:3.464101615137754587054892683011744733886
1521 # it must be exactly /^[+-]inf$/
1617 12345678901234567890:20