From: Tels Date: Sun, 16 Sep 2007 11:23:14 +0000 (+0200) Subject: [PATCHES] various small Math::BigInt et. al. fixes X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=08a3f4a9aebf0e95afafdb0217fa2977410366cf;p=p5sagit%2Fp5-mst-13.2.git [PATCHES] various small Math::BigInt et. al. fixes Message-Id: <200709161123.14970@bloodgate.com> Date: Sun, 16 Sep 2007 11:23:14 +0200 Subject: Re: [PATCHES] various small Math::BigInt et. al. fixes From: Tels Message-Id: <200709161156.09071@bloodgate.com> Date: Sun, 16 Sep 2007 11:56:08 +0200 p4raw-id: //depot/perl@31875 --- diff --git a/ext/Math/BigInt/FastCalc/FastCalc.pm b/ext/Math/BigInt/FastCalc/FastCalc.pm index 38b71fa..5fb89dc 100644 --- a/ext/Math/BigInt/FastCalc/FastCalc.pm +++ b/ext/Math/BigInt/FastCalc/FastCalc.pm @@ -1,6 +1,6 @@ package Math::BigInt::FastCalc; -use 5.006002; +use 5.006; use strict; # use warnings; # dont use warnings for older Perls @@ -11,7 +11,7 @@ use vars qw/@ISA $VERSION $BASE $BASE_LEN/; @ISA = qw(DynaLoader); -$VERSION = '0.15_01'; +$VERSION = '0.16'; bootstrap Math::BigInt::FastCalc $VERSION; @@ -34,7 +34,7 @@ BEGIN pow root sqrt log_int fac nok digit check from_hex from_bin from_oct as_hex as_bin as_oct - zeros length base_len + zeros base_len xor or and alen 1ex /) diff --git a/ext/Math/BigInt/FastCalc/Makefile.PL b/ext/Math/BigInt/FastCalc/Makefile.PL index 6307098..8ab4040 100644 --- a/ext/Math/BigInt/FastCalc/Makefile.PL +++ b/ext/Math/BigInt/FastCalc/Makefile.PL @@ -6,7 +6,7 @@ WriteMakefile( 'NAME' => 'Math::BigInt::FastCalc', 'VERSION_FROM' => 'FastCalc.pm', 'PREREQ_PM' => { - 'Math::BigInt' => 1.86, + 'Math::BigInt' => 1.88, }, INSTALLDIRS => 'perl', PREREQ_FATAL => 1, diff --git a/lib/Math/BigFloat.pm b/lib/Math/BigFloat.pm index f2eb0a4..6e1ecc8 100644 --- a/lib/Math/BigFloat.pm +++ b/lib/Math/BigFloat.pm @@ -12,8 +12,8 @@ package Math::BigFloat; # _a : accuracy # _p : precision -$VERSION = '1.58'; -require 5.006002; +$VERSION = '1.59'; +require 5.006; require Exporter; @ISA = qw/Math::BigInt/; diff --git a/lib/Math/BigInt.pm b/lib/Math/BigInt.pm index 860b68f..82da5f3 100644 --- a/lib/Math/BigInt.pm +++ b/lib/Math/BigInt.pm @@ -16,7 +16,7 @@ package Math::BigInt; # underlying lib might change the reference! my $class = "Math::BigInt"; -use 5.006002; +use 5.006; $VERSION = '1.88'; @@ -4661,31 +4661,6 @@ C exports nothing by default, but can export the following methods bgcd blcm -=head1 BUGS - -=over 2 - -=item broot() does not work - -The broot() function in BigInt may only work for small values. This will be -fixed in a later version. - -=item Out of Memory! - -Under Perl prior to 5.6.0 having an C and -C in your code will crash with "Out of memory". This is probably an -overload/exporter bug. You can workaround by not having C -and ':constant' at the same time or upgrade your Perl to a newer version. - -=item Fails to load Calc on Perl prior 5.6.0 - -Since eval(' use ...') can not be used in conjunction with ':constant', BigInt -will fall back to eval { require ... } when loading the math lib on Perls -prior to 5.6.0. This simple replaces '::' with '/' and thus might fail on -filesystems using a different seperator. - -=back - =head1 CAVEATS Some things might not work as you expect them. Below is documented what is diff --git a/lib/Math/BigInt/Calc.pm b/lib/Math/BigInt/Calc.pm index 98b88ea..52e33d2 100644 --- a/lib/Math/BigInt/Calc.pm +++ b/lib/Math/BigInt/Calc.pm @@ -1,10 +1,10 @@ package Math::BigInt::Calc; -use 5.006002; +use 5.006; use strict; # use warnings; # dont use warnings for older Perls -our $VERSION = '0.51'; +our $VERSION = '0.52'; # Package to store unsigned big integers in decimal and do math with them @@ -52,7 +52,7 @@ sub _base_len undef &_mul; undef &_div; - if ($] > 5.008 && $int && $b > 7) + if ($] >= 5.008 && $int && $b > 7) { $BASE_LEN = $b; *_mul = \&_mul_use_div_64; @@ -131,9 +131,6 @@ BEGIN $e = 5 if $^O =~ /^unicos/; # unicos is also problematic (6 seems to work # there, but we play safe) -# $e = 5 if $] < 5.006; # cap, for older Perls -# $e = 7 if $e > 7; # cap, for VMS, OS/390 and other 64 bit systems -# # 8 fails inside random testsuite, so take 7 my $int = 0; if ($e > 7) { diff --git a/lib/Math/BigRat.pm b/lib/Math/BigRat.pm index a2f0796..9e2e62d 100644 --- a/lib/Math/BigRat.pm +++ b/lib/Math/BigRat.pm @@ -14,7 +14,7 @@ package Math::BigRat; # anythig older is untested, and unlikely to work -use 5.006002; +use 5.006; use strict; use Math::BigFloat; @@ -23,7 +23,7 @@ use vars qw($VERSION @ISA $upgrade $downgrade @ISA = qw(Math::BigFloat); -$VERSION = '0.20'; +$VERSION = '0.21'; use overload; # inherit overload from Math::BigFloat @@ -1409,7 +1409,8 @@ sub as_number { my ($self,$x) = ref($_[0]) ? (undef,$_[0]) : objectify(1,@_); - return Math::BigInt->new($x) if $x->{sign} !~ /^[+-]$/; # NaN, inf etc + # NaN, inf etc + return Math::BigInt->new($x->{sign}) if $x->{sign} !~ /^[+-]$/; my $u = Math::BigInt->bzero(); $u->{sign} = $x->{sign};