Skip to content
This repository was archived by the owner on Jun 1, 2023. It is now read-only.

Commit ddd0b29

Browse files
committed
Math-BigRat: Update to 0.2612
with keeping our test fixes, and improving the still skipped bigfltpm.inc. See https://github.com/rurban/Math-BigRat/commits/cperl-rebased
1 parent 56156dc commit ddd0b29

File tree

7 files changed

+29
-20
lines changed

7 files changed

+29
-20
lines changed

Porting/Maintainers.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -981,7 +981,7 @@ package Maintainers;
981981
},
982982

983983
'Math::BigRat' => {
984-
'DISTRIBUTION' => 'PJACKLAM/Math-BigRat-0.2611.tar.gz',
984+
'DISTRIBUTION' => 'PJACKLAM/Math-BigRat-0.2612.tar.gz',
985985
'FILES' => q[cpan/Math-BigRat],
986986
'EXCLUDED' => [
987987
qr{^inc/},

cpan/Math-BigRat/lib/Math/BigRat.pm

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ use warnings;
1818

1919
use Carp ();
2020

21-
use Math::BigFloat '1.999718';
21+
use Math::BigFloat 1.999718;
2222

23-
our $VERSION = '0.2611';
23+
our $VERSION = '0.2612';
2424

2525
our @ISA = qw(Math::BigFloat);
2626

@@ -1348,15 +1348,19 @@ sub blog {
13481348
# value is used as the base, otherwise the base is assumed to be Euler's
13491349
# constant.
13501350

1351+
my ($class, $x, $base, @r);
1352+
13511353
# Don't objectify the base, since an undefined base, as in $x->blog() or
13521354
# $x->blog(undef) signals that the base is Euler's number.
13531355

1354-
# set up parameters
1355-
my ($class, $x, $base, @r) = (ref($_[0]), @_);
1356-
1357-
# objectify is costly, so avoid it
1358-
if ((!ref($_[0])) || (ref($_[0]) ne ref($_[1]))) {
1359-
($class, $x, $base, @r) = objectify(1, @_);
1356+
if (!ref($_[0]) && $_[0] =~ /^[A-Za-z]|::/) {
1357+
# E.g., Math::BigFloat->blog(256, 2)
1358+
($class, $x, $base, @r) =
1359+
defined $_[2] ? objectify(2, @_) : objectify(1, @_);
1360+
} else {
1361+
# E.g., Math::BigFloat::blog(256, 2) or $x->blog(2)
1362+
($class, $x, $base, @r) =
1363+
defined $_[1] ? objectify(2, @_) : objectify(1, @_);
13601364
}
13611365

13621366
return $x if $x->modify('blog');
@@ -1417,7 +1421,7 @@ sub bexp {
14171421

14181422
# objectify is costly, so avoid it
14191423
if ((!ref($_[0])) || (ref($_[0]) ne ref($_[1]))) {
1420-
($class, $x, $y, @r) = objectify(2, @_);
1424+
($class, $x, $y, @r) = objectify(1, @_);
14211425
}
14221426

14231427
return $x->binf(@r) if $x->{sign} eq '+inf';

cpan/Math-BigRat/t/bigfltpm.inc

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@
22

33
use strict;
44
use warnings;
5+
use vars qw($class $CL);
56

67
ok ($class->config()->{lib},$CL);
78

8-
my $z;
9+
our ($x, $y, $z, $f, $setup, $try, $ans, $ans1, @args);
910

1011
while (<DATA>)
1112
{
@@ -177,7 +178,8 @@ while (<DATA>)
177178
178179
# check whether $class->new( Math::BigInt->new()) destroys it
179180
# ($y == 12 in this case)
180-
$x = Math::BigInt->new(1200); $y = $class->new($x);
181+
$x = Math::BigInt->new(1200);
182+
$y = $class->new($x);
181183
ok ($y,1200); ok ($x,1200);
182184
183185
###############################################################################
@@ -318,13 +320,13 @@ $x = $class->new('-3.14'); $x %= $x; ok ($x, '0');
318320
#Use of uninitialized value in numeric le (<=) at BigFloat.pm line 1851.
319321

320322
$x = $class->new(0); $y = $class->new('0.1');
321-
ok ($x ** $y, 0, 'no warnings and zero result');
323+
is($x ** $y, 0, 'no warnings and zero result');
322324

323325
#perl -MMath::BigFloat -lwe 'print Math::BigFloat->new(".222222222222222222222222222222222222222222")->bceil()'
324326
#Use of uninitialized value in numeric le (<=) at BigFloat.pm line 1851.
325327

326328
$x = $class->new(".222222222222222222222222222222222222222222");
327-
ok ($x->bceil(), 1, 'no warnings and one as result');
329+
is($x->bceil(), 1, 'no warnings and one as result');
328330

329331
###############################################################################
330332
# test **=, <<=, >>=
@@ -335,7 +337,7 @@ ok ($x,"20988936657440586486151264256610222593863921");
335337
ok ($x->length(),length "20988936657440586486151264256610222593863921");
336338

337339
$x = $class->new('2');
338-
my $y = $class->new('18');
340+
$y = $class->new('18');
339341
ok ($x <<= $y, 2 << 18);
340342
ok ($x, 2 << 18);
341343
ok ($x >>= $y, 2);

cpan/Math-BigRat/t/bigfltrt.t

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ use Test::More tests => 1;
99

1010
use Math::BigRat::Test lib => 'Calc'; # test via this Subclass
1111

12-
our ($CLASS, $CALC);
13-
$CLASS = "Math::BigRat::Test";
14-
$CALC = "Math::BigInt::Calc";
12+
our ($class, $CL);
13+
$class = "Math::BigRat::Test";
14+
$CL = "Math::BigInt::Calc";
1515

1616
pass();
1717

dist/Module-CoreList/lib/Module/CoreList.pm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14733,6 +14733,7 @@ our %delta = (
1473314733
'Math::BigInt::Calc' => '1.999811',
1473414734
'Math::BigInt::CalcEmu' => '1.999811',
1473514735
'Math::BigInt::Lib' => '1.999811',
14736+
'Math::BigRat' => '0.2612',
1473614737
'Compress::Raw::Bzip2' => '2.074',
1473714738
'Compress::Raw::Zlib' => '2.074',
1473814739
'Config' => '6.23',

pod/perlcdelta.pod

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1342,10 +1342,12 @@ aliases like *Math::BigInt::FastCalc::_xxx = \&Math::BigInt::Calc::_xxx.
13421342

13431343
Use OO-calls rather than function calls. (i.e slower but overridable)
13441344

1345-
=item Math-BigRat 0.2611
1345+
=item Math-BigRat 0.2612
13461346

13471347
Updated from CPAN: No functional changes,
13481348
and the few actual changes in the test lib were for the worse.
1349+
The F<bigfltpm.inc> tests are still broken and skipped, however
1350+
I improved it.
13491351

13501352
=item Module-Load-Conditional 0.68
13511353

t/porting/customized.dat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ Math::BigInt cpan/Math-BigInt/t/sub_mif.t e87738bd15116665c38d9f41b310cfe7fbf6da
8484
Math::BigInt cpan/Math-BigInt/t/upgrade.t 7c15cac7f321ca396648ec45da6389a1283e1546
8585
Math::BigInt cpan/Math-BigInt/t/upgradef.t 06610e9883ce805bcd6543ab959a9826f598eb40
8686
Math::BigInt cpan/Math-BigInt/t/with_sub.t c040328e223df6f56250f5d67dcb2c9a2f23c110
87-
Module::CoreList dist/Module-CoreList/lib/Module/CoreList.pm ce12052106c5c00694bc629245de7c5b6399bfd4
87+
Module::CoreList dist/Module-CoreList/lib/Module/CoreList.pm 7ee910eef0ea12f2d2ae956249baba6e3e191509
8888
Module::CoreList dist/Module-CoreList/lib/Module/CoreList/Utils.pm 67d48d6d19234473699266139fbe0e7f582727ac
8989
Module::Metadata cpan/Module-Metadata/t/lib/GeneratePackage.pm 502ffbe2609947430e6aa1a3df8064b3fef3e086
9090
Net::Domain cpan/libnet/lib/Net/Cmd.pm 70a007c38833667ad47ea8059c37c1b7d1c77b6c

0 commit comments

Comments
 (0)