r74472 - in /branches/upstream/libmath-basecalc-perl/current: Build.PL Changes MANIFEST META.yml Makefile.PL README SIGNATURE dist.ini lib/Math/BaseCalc.pm t/01_basic_tests.t t/04-bigint.t
jotamjr-guest at users.alioth.debian.org
jotamjr-guest at users.alioth.debian.org
Sun May 15 15:25:58 UTC 2011
Author: jotamjr-guest
Date: Sun May 15 15:25:33 2011
New Revision: 74472
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=74472
Log:
[svn-upgrade] new version libmath-basecalc-perl (1.016)
Added:
branches/upstream/libmath-basecalc-perl/current/t/04-bigint.t
Modified:
branches/upstream/libmath-basecalc-perl/current/Build.PL
branches/upstream/libmath-basecalc-perl/current/Changes
branches/upstream/libmath-basecalc-perl/current/MANIFEST
branches/upstream/libmath-basecalc-perl/current/META.yml
branches/upstream/libmath-basecalc-perl/current/Makefile.PL
branches/upstream/libmath-basecalc-perl/current/README
branches/upstream/libmath-basecalc-perl/current/SIGNATURE
branches/upstream/libmath-basecalc-perl/current/dist.ini
branches/upstream/libmath-basecalc-perl/current/lib/Math/BaseCalc.pm
branches/upstream/libmath-basecalc-perl/current/t/01_basic_tests.t
Modified: branches/upstream/libmath-basecalc-perl/current/Build.PL
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libmath-basecalc-perl/current/Build.PL?rev=74472&op=diff
==============================================================================
--- branches/upstream/libmath-basecalc-perl/current/Build.PL (original)
+++ branches/upstream/libmath-basecalc-perl/current/Build.PL Sun May 15 15:25:33 2011
@@ -12,7 +12,7 @@
'Test::More' => '0'
},
'configure_requires' => {
- 'ExtUtils::MakeMaker' => '6.31',
+ 'ExtUtils::MakeMaker' => '6.30',
'Module::Build' => '0.3601'
},
'dist_abstract' => 'Convert numbers between various bases',
@@ -20,7 +20,7 @@
'Ken Williams <kwilliams at cpan.org>'
],
'dist_name' => 'Math-BaseCalc',
- 'dist_version' => '1.015',
+ 'dist_version' => '1.016',
'license' => 'perl',
'module_name' => 'Math::BaseCalc',
'recommends' => {},
Modified: branches/upstream/libmath-basecalc-perl/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libmath-basecalc-perl/current/Changes?rev=74472&op=diff
==============================================================================
--- branches/upstream/libmath-basecalc-perl/current/Changes (original)
+++ branches/upstream/libmath-basecalc-perl/current/Changes Sun May 15 15:25:33 2011
@@ -1,4 +1,8 @@
Revision history for Perl extension Math::BaseCalc.
+
+1.16 - Fri May 13 22:16:37 CDT 2011
+
+ - Added some minimal support for Math::BigInt.
1.15 - Tue May 10 23:34:09 CDT 2011
Modified: branches/upstream/libmath-basecalc-perl/current/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libmath-basecalc-perl/current/MANIFEST?rev=74472&op=diff
==============================================================================
--- branches/upstream/libmath-basecalc-perl/current/MANIFEST (original)
+++ branches/upstream/libmath-basecalc-perl/current/MANIFEST Sun May 15 15:25:33 2011
@@ -11,5 +11,6 @@
t/01_basic_tests.t
t/02_digit_dash.t
t/03_large_int.t
+t/04-bigint.t
t/99_podcoverage.t
t/author-critic.t
Modified: branches/upstream/libmath-basecalc-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libmath-basecalc-perl/current/META.yml?rev=74472&op=diff
==============================================================================
--- branches/upstream/libmath-basecalc-perl/current/META.yml (original)
+++ branches/upstream/libmath-basecalc-perl/current/META.yml Sun May 15 15:25:33 2011
@@ -7,10 +7,10 @@
Module::Build: 0.3601
Test::More: 0
configure_requires:
- ExtUtils::MakeMaker: 6.31
+ ExtUtils::MakeMaker: 6.30
Module::Build: 0.3601
dynamic_config: 0
-generated_by: 'Dist::Zilla version 4.200000, CPAN::Meta::Converter version 2.102400'
+generated_by: 'Dist::Zilla version 4.200006, CPAN::Meta::Converter version 2.102400'
license: perl
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.4.html
@@ -23,4 +23,4 @@
resources:
bugtracker: http://rt.cpan.org/Public/Dist/Display.html?Name=Math-BaseCalc
repository: http://perl-math-basecalc.googlecode.com/svn/trunk
-version: 1.015
+version: 1.016
Modified: branches/upstream/libmath-basecalc-perl/current/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libmath-basecalc-perl/current/Makefile.PL?rev=74472&op=diff
==============================================================================
--- branches/upstream/libmath-basecalc-perl/current/Makefile.PL (original)
+++ branches/upstream/libmath-basecalc-perl/current/Makefile.PL Sun May 15 15:25:33 2011
@@ -4,7 +4,7 @@
-use ExtUtils::MakeMaker 6.31;
+use ExtUtils::MakeMaker 6.30;
@@ -17,7 +17,7 @@
'Test::More' => '0'
},
'CONFIGURE_REQUIRES' => {
- 'ExtUtils::MakeMaker' => '6.31',
+ 'ExtUtils::MakeMaker' => '6.30',
'Module::Build' => '0.3601'
},
'DISTNAME' => 'Math-BaseCalc',
@@ -29,7 +29,7 @@
'integer' => '0',
'vars' => '0'
},
- 'VERSION' => '1.015',
+ 'VERSION' => '1.016',
'test' => {
'TESTS' => 't/*.t'
}
Modified: branches/upstream/libmath-basecalc-perl/current/README
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libmath-basecalc-perl/current/README?rev=74472&op=diff
==============================================================================
--- branches/upstream/libmath-basecalc-perl/current/README (original)
+++ branches/upstream/libmath-basecalc-perl/current/README Sun May 15 15:25:33 2011
@@ -1,7 +1,7 @@
This archive contains the distribution Math-BaseCalc,
-version 1.015:
+version 1.016:
Convert numbers between various bases
Modified: branches/upstream/libmath-basecalc-perl/current/SIGNATURE
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libmath-basecalc-perl/current/SIGNATURE?rev=74472&op=diff
==============================================================================
--- branches/upstream/libmath-basecalc-perl/current/SIGNATURE (original)
+++ branches/upstream/libmath-basecalc-perl/current/SIGNATURE Sun May 15 15:25:33 2011
@@ -14,24 +14,25 @@
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
-SHA1 32a39b3267a46cf3b9b991723353466cf88061f2 Build.PL
-SHA1 3c608d2673b4b8a2dbd0089b1d1d14c3a60d8a15 Changes
+SHA1 41ebbb6b2aee67cb1530b708c5b5c0b44d5f8145 Build.PL
+SHA1 205b41a7d87c2c4f304e866263b62da1b0cb79a4 Changes
SHA1 da0b89eff79e9d5128ab28d63e099b840cca39bf LICENSE
-SHA1 a7a0401e66e934d0f23564067eec7a5f966c5a65 MANIFEST
-SHA1 10bb6ef71813948cf712a47a3a6e6521ef8c7a4d META.yml
-SHA1 9e97c24ad5d61937fe143f4164862d34bd5634d1 Makefile.PL
-SHA1 16f9fe47c1f606e7e36c70e8d6c196dd2077ea94 README
-SHA1 6ab91180b739297db6bc7b2902feecd88e98f33c dist.ini
-SHA1 f00eb49958cd9bdad22019194b4adee38a8ad4c4 lib/Math/BaseCalc.pm
-SHA1 c53f842995fd8e7bbbffff1a7f43d6086a3bd904 t/01_basic_tests.t
+SHA1 1babfc80e8fd29edd3ce40d5e1a5b47b897bdc27 MANIFEST
+SHA1 5790a80b38842fb29afbc678e15d77261733d900 META.yml
+SHA1 5e6ee1804350fbfc37c81ad96b4cf5f2ce4f4ea2 Makefile.PL
+SHA1 0cbd1ae1fac6d799eebca3003f825082b883e18c README
+SHA1 f470c215a0e488a0884f8db078ebe26652e8fabb dist.ini
+SHA1 5e91ad1bd28657302ac62a9751b86512a0936bc8 lib/Math/BaseCalc.pm
+SHA1 a52b1831709cb6285f42ae5c644129080d5adec2 t/01_basic_tests.t
SHA1 d555c130952881de5faacbe7f0def8a5bdb36354 t/02_digit_dash.t
SHA1 c1d920f2be7b2de4b422b11c4c93dfbb99fe381e t/03_large_int.t
+SHA1 77fb597fc70384d0688b72003457a567b0bd84b9 t/04-bigint.t
SHA1 19e797985fada8c25f13ce5f0fb873999c3cbe44 t/99_podcoverage.t
SHA1 fa45d6e6ab1cd421349dea4ef527bfd5cdc8a09e t/author-critic.t
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (Darwin)
-iD8DBQFNyhH9grvMBLfvlHYRAq+GAJ9RbncD61nwnA54b0xX96wx4iPGCwCaA9q9
-5ArBqWOIlFH8naRk+I9r1Jk=
-=2XSW
+iD8DBQFNzfSpgrvMBLfvlHYRAk8KAJ4hE3I6FI1LxKCUUH2fupI0+VnNlgCggPqL
+jFtxmOaX1RZXCk0kyzvJtFs=
+=KNpy
-----END PGP SIGNATURE-----
Modified: branches/upstream/libmath-basecalc-perl/current/dist.ini
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libmath-basecalc-perl/current/dist.ini?rev=74472&op=diff
==============================================================================
--- branches/upstream/libmath-basecalc-perl/current/dist.ini (original)
+++ branches/upstream/libmath-basecalc-perl/current/dist.ini Sun May 15 15:25:33 2011
@@ -1,5 +1,5 @@
name = Math-BaseCalc
-version = 1.015
+version = 1.016
author = Ken Williams <kwilliams at cpan.org>
license = Perl_5
copyright_holder = Ken Williams
Modified: branches/upstream/libmath-basecalc-perl/current/lib/Math/BaseCalc.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libmath-basecalc-perl/current/lib/Math/BaseCalc.pm?rev=74472&op=diff
==============================================================================
--- branches/upstream/libmath-basecalc-perl/current/lib/Math/BaseCalc.pm (original)
+++ branches/upstream/libmath-basecalc-perl/current/lib/Math/BaseCalc.pm Sun May 15 15:25:33 2011
@@ -98,7 +98,7 @@
=head1 VERSION
-version 1.015
+version 1.016
=head1 SYNOPSIS
@@ -156,11 +156,18 @@
Converts a number to a string representing that number in the
associated base.
+If C<NUMBER> is a C<Math::BigInt> object, C<to_base()> will still work
+fine and give you an exact result string.
+
=item * $calc->from_base(STRING)
Converts a string representing a number in the associated base to a
Perl integer. The behavior when fed strings with characters not in
$calc's digit set is currently undefined.
+
+If C<STRING> converts to a number too large for perl's integer
+representation, beware that the result may be auto-converted to a
+floating-point representation and thus only be an approximation.
=item * $calc->digits
Modified: branches/upstream/libmath-basecalc-perl/current/t/01_basic_tests.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libmath-basecalc-perl/current/t/01_basic_tests.t?rev=74472&op=diff
==============================================================================
--- branches/upstream/libmath-basecalc-perl/current/t/01_basic_tests.t (original)
+++ branches/upstream/libmath-basecalc-perl/current/t/01_basic_tests.t Sun May 15 15:25:33 2011
@@ -63,10 +63,10 @@
{
# Test large numbers
$calc->digits('hex');
- my $r1 = $calc->to_base(2**55 + 5);
- my $result = $calc->from_base($calc->to_base(2**55 + 5));
+ my $r1 = $calc->to_base(2**30 + 5);
+ my $result = $calc->from_base($calc->to_base(2**30 + 5));
#warn "res: $r1, $result";
- is($result, int(2**55 + 5), "hex (2**55 + 5) into hex then back");
+ is($result, int(2**30 + 5), "hex (2**30 + 5) into hex then back");
}
{
Added: branches/upstream/libmath-basecalc-perl/current/t/04-bigint.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libmath-basecalc-perl/current/t/04-bigint.t?rev=74472&op=file
==============================================================================
--- branches/upstream/libmath-basecalc-perl/current/t/04-bigint.t (added)
+++ branches/upstream/libmath-basecalc-perl/current/t/04-bigint.t Sun May 15 15:25:33 2011
@@ -1,0 +1,29 @@
+use Test::More;
+use strict;
+use warnings;
+
+eval "use Math::BigInt";
+if ($@) {
+ plan skip_all => "Requires Math::BigInt";
+} else {
+ plan tests => 4;
+}
+
+use_ok('Math::BaseCalc');
+
+my $bignum = Math::BigInt->new(2) ** 120 + 7;
+
+roundtrip36( $bignum, '24q5bylddqo566k7npiubn5z' );
+
+
+sub roundtrip36 {
+ my ($num, $expect) = @_;
+
+ my $calc36 = new Math::BaseCalc(digits=>[0..9,'a'..'z']);
+ my $base36 = $calc36->to_base($num);
+ is($base36, $expect, "to_base has done proper conversion of $num");
+ my $num2 = $calc36->from_base($base36);
+ is($num2, $num->numify, "$num has roundtripped");
+ $num2 = $calc36->from_base($expect);
+ is($num2, $num->numify, "from_base correct for $expect ($num)");
+}
More information about the Pkg-perl-cvs-commits
mailing list