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 <nospam-abuse@bloodgate.com>
Message-Id: <
200709161156.09071@bloodgate.com>
Date: Sun, 16 Sep 2007 11:56:08 +0200
p4raw-id: //depot/perl@31875
package Math::BigInt::FastCalc;
-use 5.006002;
+use 5.006;
use strict;
# use warnings; # dont use warnings for older Perls
@ISA = qw(DynaLoader);
-$VERSION = '0.15_01';
+$VERSION = '0.16';
bootstrap Math::BigInt::FastCalc $VERSION;
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
/)
'NAME' => 'Math::BigInt::FastCalc',
'VERSION_FROM' => 'FastCalc.pm',
'PREREQ_PM' => {
- 'Math::BigInt' => 1.86,
+ 'Math::BigInt' => 1.88,
},
INSTALLDIRS => 'perl',
PREREQ_FATAL => 1,
# _a : accuracy
# _p : precision
-$VERSION = '1.58';
-require 5.006002;
+$VERSION = '1.59';
+require 5.006;
require Exporter;
@ISA = qw/Math::BigInt/;
# underlying lib might change the reference!
my $class = "Math::BigInt";
-use 5.006002;
+use 5.006;
$VERSION = '1.88';
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<use Math::BigInt ':constant';> and
-C<eval()> in your code will crash with "Out of memory". This is probably an
-overload/exporter bug. You can workaround by not having C<eval()>
-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
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
undef &_mul;
undef &_div;
- if ($] > 5.008 && $int && $b > 7)
+ if ($] >= 5.008 && $int && $b > 7)
{
$BASE_LEN = $b;
*_mul = \&_mul_use_div_64;
$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)
{
package Math::BigRat;
# anythig older is untested, and unlikely to work
-use 5.006002;
+use 5.006;
use strict;
use Math::BigFloat;
@ISA = qw(Math::BigFloat);
-$VERSION = '0.20';
+$VERSION = '0.21';
use overload; # inherit overload from Math::BigFloat
{
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};