/[pkgs]/devel/perl/18_fix_bigint_floats
ViewVC logotype

Contents of /devel/perl/18_fix_bigint_floats

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations) (download)
Wed Mar 11 22:01:05 2009 UTC (8 months, 1 week ago) by spot
Branch: MAIN
CVS Tags: F-12-split, perl-5_10_0-63_fc11, perl-5_10_0-61_fc11, perl-5_10_0-80_fc12, perl-5_10_0-81_fc12, perl-5_10_0-84_fc13, perl-5_10_0-82_fc13, perl-5_10_0-77_fc12, perl-5_10_0-83_fc13, perl-5_10_0-71_fc12, perl-5_10_0-75_fc12, perl-5_10_0-73_fc12, perl-5_10_0-68_fc11, perl-5_10_0-67_fc11, perl-5_10_0-64_fc11, perl-5_10_0-72_fc12, F-11-split, perl-5_10_0-62_fc11, perl-5_10_0-69_fc12, perl-5_10_0-79_fc12, perl-5_10_0-78_fc12, perl-5_10_0-70_fc12, perl-5_10_0-74_fc12, perl-5_10_0-66_fc11, perl-5_10_0-65_fc11, perl-5_10_0-76_fc12, HEAD
reorder @INC, fix bz 489204, merge useful debian patches
1 Fix Math::BigFloat::sqrt() breaking with too many digits. (Closes: #417528)
2
3 Dual-lived module, fixed on the CPAN side in 1.89.
4
5 Integrated with the other 1.89 changes in blead as change 33715
6 and maint-5.10 as change 33821.
7
8 [rt.cpan.org #34459]
9 diff --git a/lib/Math/BigFloat.pm b/lib/Math/BigFloat.pm
10 index 6e1ecc8..1c1fba8 100644
11 --- a/lib/Math/BigFloat.pm
12 +++ b/lib/Math/BigFloat.pm
13 @@ -2142,8 +2142,9 @@ sub bsqrt
14 # But we need at least $scale digits, so calculate how many are missing
15 my $shift = $scale - $digits;
16
17 - # That should never happen (we take care of integer guesses above)
18 - # $shift = 0 if $shift < 0;
19 + # This happens if the input had enough digits
20 + # (we take care of integer guesses above)
21 + $shift = 0 if $shift < 0;
22
23 # Multiply in steps of 100, by shifting left two times the "missing" digits
24 my $s2 = $shift * 2;
25 diff --git a/lib/Math/BigInt/t/mbimbf.t b/lib/Math/BigInt/t/mbimbf.t
26 index fae3c8c..88201e1 100644
27 --- a/lib/Math/BigInt/t/mbimbf.t
28 +++ b/lib/Math/BigInt/t/mbimbf.t
29 @@ -32,7 +32,7 @@ BEGIN
30 print "# INC = @INC\n";
31
32 plan tests => 684
33 - + 23; # own tests
34 + + 26; # own tests
35 }
36
37 use Math::BigInt 1.70;
38 @@ -100,3 +100,9 @@ $x = Math::BigFloat->new(100);
39 $x = $x->blog(Math::BigInt->new(10));
40
41 ok ($x,2);
42 +
43 +for my $i (80,88,100) {
44 + $x = Math::BigFloat->new("1." . ("0" x $i) . "1");
45 + $x = $x->bsqrt;
46 + ok ($x, 1);
47 +}

admin@fedoraproject.org
ViewVC Help
Powered by ViewVC 1.1.2