Commit a6bf488f authored by Angel Abad's avatar Angel Abad

New upstream version 1.999803

parent 7a9cfe34
Please see <http://bloodgate.com/perl/bigint/benchmarks.html> for detailed and
up-todate benchmarks, as well as a program to generate them.
This source diff could not be displayed because it is too large. You can view the blob instead.
This program is free software; you may redistribute it and/or modify it
under the same terms as Perl itself.
Tels <http://bloodgate.com/>
BENCHMARK
BUGS
CHANGES
CREDITS
......@@ -7,14 +6,6 @@ examples/bigprimes.pl
examples/prime.pl
GOALS
HISTORY
inc/Module/Install.pm
inc/Module/Install/Base.pm
inc/Module/Install/Can.pm
inc/Module/Install/Fetch.pm
inc/Module/Install/Makefile.pm
inc/Module/Install/Metadata.pm
inc/Module/Install/Win32.pm
inc/Module/Install/WriteAll.pm
lib/Math/BigFloat.pm
lib/Math/BigInt.pm
lib/Math/BigInt/Calc.pm
......@@ -156,6 +147,7 @@ t/from_oct-mbf.t
t/inf_nan.t
t/isa.t
t/lib_load.t
t/Math/BigFloat/#Subclass.pm#
t/Math/BigFloat/Subclass.pm
t/Math/BigInt/BareCalc.pm
t/Math/BigInt/Lib/Minimal.pm
......
{
"abstract" : "Arbitrary size integer/float math package",
"abstract" : "unknown",
"author" : [
"=over 4, Peter John Acklam <pjacklam@online.no>"
"Peter John Acklam <pjacklam@gmail.com>"
],
"dynamic_config" : 1,
"generated_by" : "ExtUtils::MakeMaker version 7.24, CPAN::Meta::Converter version 2.150010",
......@@ -22,8 +22,7 @@
"prereqs" : {
"build" : {
"requires" : {
"ExtUtils::MakeMaker" : "6.59",
"Test::More" : "0.94"
"ExtUtils::MakeMaker" : "0"
}
},
"configure" : {
......@@ -40,6 +39,6 @@
}
},
"release_status" : "stable",
"version" : "1.999802",
"version" : "1.999803",
"x_serialization_backend" : "JSON::PP version 2.27400"
}
---
abstract: 'Arbitrary size integer/float math package'
abstract: unknown
author:
- '=over 4, Peter John Acklam <pjacklam@online.no>'
- 'Peter John Acklam <pjacklam@gmail.com>'
build_requires:
ExtUtils::MakeMaker: '6.59'
Test::More: '0.94'
ExtUtils::MakeMaker: '0'
configure_requires:
ExtUtils::MakeMaker: '0'
dynamic_config: 1
......@@ -22,5 +21,5 @@ requires:
Math::Complex: '1.39'
Test::More: '0.94'
perl: '5.006001'
version: '1.999802'
version: '1.999803'
x_serialization_backend: 'CPAN::Meta::YAML version 0.018'
#!perl
# We need at least Perl 5.6.1
require 5.006001;
use strict;
# Load the Module::Install bundled in ./inc/
use inc::Module::Install;
# The name of your distribution
name 'Math-BigInt';
# Get most of the details from the primary module
all_from 'lib/Math/BigInt.pm';
# Required versions.
requires 'perl' => 5.006001;
requires 'Math::Complex' => 1.39,
test_requires 'Test::More' => 0.94;
install_as_core();
license 'perl';
author 'Peter John Acklam <pjacklam@online.no>';
# Do not index these
no_index directory => 'examples';
sign;
# Generate the Makefile
WriteAll;
1;
use warnings;
use ExtUtils::MakeMaker;
WriteMakefile
(
'NAME' => 'Math::BigInt',
'VERSION_FROM' => 'lib/Math/BigInt.pm',
'AUTHOR' => 'Peter John Acklam <pjacklam@gmail.com>',
'MIN_PERL_VERSION' => 5.006001,
'PREREQ_PM' => {
#'ExtUtils::MakeMaker' => 6.58,
'Test::More' => 0.94,
'Math::Complex' => 1.39,
},
'LICENSE' => 'perl_5',
'LIBS' => [''], # e.g., '-lm'
'DEFINE' => '', # e.g., '-DHAVE_SOMETHING'
'INC' => '', # e.g., '-I/usr/include/other'
'SIGN' => 1,
);
This diff is collapsed.
The following list is not up to date:
See also various .pm files.
General:
......
This diff is collapsed.
#line 1
package Module::Install::Base;
use strict 'vars';
use vars qw{$VERSION};
BEGIN {
$VERSION = '1.17';
}
# Suspend handler for "redefined" warnings
BEGIN {
my $w = $SIG{__WARN__};
$SIG{__WARN__} = sub { $w };
}
#line 42
sub new {
my $class = shift;
unless ( defined &{"${class}::call"} ) {
*{"${class}::call"} = sub { shift->_top->call(@_) };
}
unless ( defined &{"${class}::load"} ) {
*{"${class}::load"} = sub { shift->_top->load(@_) };
}
bless { @_ }, $class;
}
#line 61
sub AUTOLOAD {
local $@;
my $func = eval { shift->_top->autoload } or return;
goto &$func;
}
#line 75
sub _top {
$_[0]->{_top};
}
#line 90
sub admin {
$_[0]->_top->{admin}
or
Module::Install::Base::FakeAdmin->new;
}
#line 106
sub is_admin {
! $_[0]->admin->isa('Module::Install::Base::FakeAdmin');
}
sub DESTROY {}
package Module::Install::Base::FakeAdmin;
use vars qw{$VERSION};
BEGIN {
$VERSION = $Module::Install::Base::VERSION;
}
my $fake;
sub new {
$fake ||= bless(\@_, $_[0]);
}
sub AUTOLOAD {}
sub DESTROY {}
# Restore warning handler
BEGIN {
$SIG{__WARN__} = $SIG{__WARN__}->();
}
1;
#line 159
#line 1
package Module::Install::Can;
use strict;
use Config ();
use ExtUtils::MakeMaker ();
use Module::Install::Base ();
use vars qw{$VERSION @ISA $ISCORE};
BEGIN {
$VERSION = '1.17';
@ISA = 'Module::Install::Base';
$ISCORE = 1;
}
# check if we can load some module
### Upgrade this to not have to load the module if possible
sub can_use {
my ($self, $mod, $ver) = @_;
$mod =~ s{::|\\}{/}g;
$mod .= '.pm' unless $mod =~ /\.pm$/i;
my $pkg = $mod;
$pkg =~ s{/}{::}g;
$pkg =~ s{\.pm$}{}i;
local $@;
eval { require $mod; $pkg->VERSION($ver || 0); 1 };
}
# Check if we can run some command
sub can_run {
my ($self, $cmd) = @_;
my $_cmd = $cmd;
return $_cmd if (-x $_cmd or $_cmd = MM->maybe_command($_cmd));
for my $dir ((split /$Config::Config{path_sep}/, $ENV{PATH}), '.') {
next if $dir eq '';
require File::Spec;
my $abs = File::Spec->catfile($dir, $cmd);
return $abs if (-x $abs or $abs = MM->maybe_command($abs));
}
return;
}
# Can our C compiler environment build XS files
sub can_xs {
my $self = shift;
# Ensure we have the CBuilder module
$self->configure_requires( 'ExtUtils::CBuilder' => 0.27 );
# Do we have the configure_requires checker?
local $@;
eval "require ExtUtils::CBuilder;";
if ( $@ ) {
# They don't obey configure_requires, so it is
# someone old and delicate. Try to avoid hurting
# them by falling back to an older simpler test.
return $self->can_cc();
}
# Do we have a working C compiler
my $builder = ExtUtils::CBuilder->new(
quiet => 1,
);
unless ( $builder->have_compiler ) {
# No working C compiler
return 0;
}
# Write a C file representative of what XS becomes
require File::Temp;
my ( $FH, $tmpfile ) = File::Temp::tempfile(
"compilexs-XXXXX",
SUFFIX => '.c',
);
binmode $FH;
print $FH <<'END_C';
#include "EXTERN.h"
#include "perl.h"
#include "XSUB.h"
int main(int argc, char **argv) {
return 0;
}
int boot_sanexs() {
return 1;
}
END_C
close $FH;
# Can the C compiler access the same headers XS does
my @libs = ();
my $object = undef;
eval {
local $^W = 0;
$object = $builder->compile(
source => $tmpfile,
);
@libs = $builder->link(
objects => $object,
module_name => 'sanexs',
);
};
my $result = $@ ? 0 : 1;
# Clean up all the build files
foreach ( $tmpfile, $object, @libs ) {
next unless defined $_;
1 while unlink;
}
return $result;
}
# Can we locate a (the) C compiler
sub can_cc {
my $self = shift;
if ($^O eq 'VMS') {
require ExtUtils::CBuilder;
my $builder = ExtUtils::CBuilder->new(
quiet => 1,
);
return $builder->have_compiler;
}
my @chunks = split(/ /, $Config::Config{cc}) or return;
# $Config{cc} may contain args; try to find out the program part
while (@chunks) {
return $self->can_run("@chunks") || (pop(@chunks), next);
}
return;
}
# Fix Cygwin bug on maybe_command();
if ( $^O eq 'cygwin' ) {
require ExtUtils::MM_Cygwin;
require ExtUtils::MM_Win32;
if ( ! defined(&ExtUtils::MM_Cygwin::maybe_command) ) {
*ExtUtils::MM_Cygwin::maybe_command = sub {
my ($self, $file) = @_;
if ($file =~ m{^/cygdrive/}i and ExtUtils::MM_Win32->can('maybe_command')) {
ExtUtils::MM_Win32->maybe_command($file);
} else {
ExtUtils::MM_Unix->maybe_command($file);
}
}
}
}
1;
__END__
#line 245
#line 1
package Module::Install::Fetch;
use strict;
use Module::Install::Base ();
use vars qw{$VERSION @ISA $ISCORE};
BEGIN {
$VERSION = '1.17';
@ISA = 'Module::Install::Base';
$ISCORE = 1;
}
sub get_file {
my ($self, %args) = @_;
my ($scheme, $host, $path, $file) =
$args{url} =~ m|^(\w+)://([^/]+)(.+)/(.+)| or return;
if ( $scheme eq 'http' and ! eval { require LWP::Simple; 1 } ) {
$args{url} = $args{ftp_url}
or (warn("LWP support unavailable!\n"), return);
($scheme, $host, $path, $file) =
$args{url} =~ m|^(\w+)://([^/]+)(.+)/(.+)| or return;
}
$|++;
print "Fetching '$file' from $host... ";
unless (eval { require Socket; Socket::inet_aton($host) }) {
warn "'$host' resolve failed!\n";
return;
}
return unless $scheme eq 'ftp' or $scheme eq 'http';
require Cwd;
my $dir = Cwd::getcwd();
chdir $args{local_dir} or return if exists $args{local_dir};
if (eval { require LWP::Simple; 1 }) {
LWP::Simple::mirror($args{url}, $file);
}
elsif (eval { require Net::FTP; 1 }) { eval {
# use Net::FTP to get past firewall
my $ftp = Net::FTP->new($host, Passive => 1, Timeout => 600);
$ftp->login("anonymous", 'anonymous@example.com');
$ftp->cwd($path);
$ftp->binary;
$ftp->get($file) or (warn("$!\n"), return);
$ftp->quit;
} }
elsif (my $ftp = $self->can_run('ftp')) { eval {
# no Net::FTP, fallback to ftp.exe
require FileHandle;
my $fh = FileHandle->new;
local $SIG{CHLD} = 'IGNORE';
unless ($fh->open("|$ftp -n")) {
warn "Couldn't open ftp: $!\n";
chdir $dir; return;
}
my @dialog = split(/\n/, <<"END_FTP");
open $host
user anonymous anonymous\@example.com
cd $path
binary
get $file $file
quit
END_FTP
foreach (@dialog) { $fh->print("$_\n") }
$fh->close;
} }
else {
warn "No working 'ftp' program available!\n";
chdir $dir; return;
}
unless (-f $file) {
warn "Fetching failed: $@\n";
chdir $dir; return;
}
return if exists $args{size} and -s $file != $args{size};
system($args{run}) if exists $args{run};
unlink($file) if $args{remove};
print(((!exists $args{check_for} or -e $args{check_for})
? "done!" : "failed! ($!)"), "\n");
chdir $dir; return !$?;
}
1;
This diff is collapsed.
This diff is collapsed.
#line 1
package Module::Install::Win32;
use strict;
use Module::Install::Base ();
use vars qw{$VERSION @ISA $ISCORE};
BEGIN {
$VERSION = '1.17';
@ISA = 'Module::Install::Base';
$ISCORE = 1;
}
# determine if the user needs nmake, and download it if needed
sub check_nmake {
my $self = shift;
$self->load('can_run');
$self->load('get_file');
require Config;
return unless (
$^O eq 'MSWin32' and
$Config::Config{make} and
$Config::Config{make} =~ /^nmake\b/i and
! $self->can_run('nmake')
);
print "The required 'nmake' executable not found, fetching it...\n";
require File::Basename;
my $rv = $self->get_file(
url => 'http://download.microsoft.com/download/vc15/Patch/1.52/W95/EN-US/Nmake15.exe',
ftp_url => 'ftp://ftp.microsoft.com/Softlib/MSLFILES/Nmake15.exe',
local_dir => File::Basename::dirname($^X),
size => 51928,
run => 'Nmake15.exe /o > nul',
check_for => 'Nmake.exe',
remove => 1,
);
die <<'END_MESSAGE' unless $rv;
-------------------------------------------------------------------------------
Since you are using Microsoft Windows, you will need the 'nmake' utility
before installation. It's available at:
http://download.microsoft.com/download/vc15/Patch/1.52/W95/EN-US/Nmake15.exe
or
ftp://ftp.microsoft.com/Softlib/MSLFILES/Nmake15.exe
Please download the file manually, save it to a directory in %PATH% (e.g.
C:\WINDOWS\COMMAND\), then launch the MS-DOS command line shell, "cd" to
that directory, and run "Nmake15.exe" from there; that will create the
'nmake.exe' file needed by this module.
You may then resume the installation process described in README.
-------------------------------------------------------------------------------
END_MESSAGE
}
1;
#line 1
package Module::Install::WriteAll;
use strict;
use Module::Install::Base ();
use vars qw{$VERSION @ISA $ISCORE};
BEGIN {
$VERSION = '1.17';
@ISA = qw{Module::Install::Base};
$ISCORE = 1;
}
sub WriteAll {
my $self = shift;
my %args = (
meta => 1,
sign => 0,
inline => 0,
check_nmake => 1,
@_,
);
$self->sign(1) if $args{sign};
$self->admin->WriteAll(%args) if $self->is_admin;
$self->check_nmake if $args{check_nmake};
unless ( $self->makemaker_args->{PL_FILES} ) {
# XXX: This still may be a bit over-defensive...
unless ($self->makemaker(6.25)) {
$self->makemaker_args( PL_FILES => {} ) if -f 'Build.PL';
}
}
# Until ExtUtils::MakeMaker support MYMETA.yml, make sure
# we clean it up properly ourself.
$self->realclean_files('MYMETA.yml');
if ( $args{inline} ) {
$self->Inline->write;
} else {
$self->Makefile->write;
}
# The Makefile write process adds a couple of dependencies,
# so write the META.yml files after the Makefile.
if ( $args{meta} ) {
$self->Meta->write;
}
# Experimental support for MYMETA
if ( $ENV{X_MYMETA} ) {
if ( $ENV{X_MYMETA} eq 'JSON' ) {
$self->Meta->write_mymeta_json;
} else {
$self->Meta->write_mymeta_yaml;
}
}
return 1;
}
1;
......@@ -19,8 +19,7 @@ use warnings;
use Carp ();
use Math::BigInt ();
our $VERSION = '1.999802';
$VERSION = eval $VERSION;
our $VERSION = '1.999803';
require Exporter;
our @ISA = qw/Math::BigInt/;
......
......@@ -20,8 +20,7 @@ use warnings;
use Carp ();
our $VERSION = '1.999802';
$VERSION = eval $VERSION;
our $VERSION = '1.999803';
our @ISA = qw(Exporter);
our @EXPORT_OK = qw(objectify bgcd blcm);
......
......@@ -7,8 +7,7 @@ use warnings;
use Carp;
use Math::BigInt::Lib;
our $VERSION = '1.999802';
$VERSION = eval $VERSION;
our $VERSION = '1.999803';
our @ISA = ('Math::BigInt::Lib');
......
......@@ -4,8 +4,7 @@ use 5.006001;
use strict;
use warnings;
our $VERSION = '1.999802';
$VERSION = eval $VERSION;
our $VERSION = '1.999803';
package Math::BigInt;
......
......@@ -4,8 +4,7 @@ use 5.006001;
use strict;
use warnings;
our $VERSION = '1.999802';
$VERSION = eval $VERSION;
our $VERSION = '1.999803';
use Carp;
......
File mode changed from 100755 to 100644
#!perl
# for testing subclassing Math::BigFloat
package Math::BigFloat::Subclass;
require 5.006;
use strict;
use warnings;
use Exporter;
use Math::BigFloat 1.38;
our ($accuracy, $precision, $round_mode, $div_scale);
our @ISA = qw(Exporter Math::BigFloat);
our $VERSION = "0.06";
use overload; # inherit overload from BigInt
# Globals
$accuracy = $precision = undef;
$round_mode = 'even';
$div_scale = 40;
sub new {
my $proto = shift;
my $class = ref($proto) || $proto;
my $value = shift;
my $a = $accuracy; $a = $_[0] if defined $_[0];
my $p = $precision; $p = $_[1] if defined $_[1];
# Store the floating point value
my $self = Math::BigFloat->new($value, $a, $p, $round_mode);
bless $self, $class;
$self->{'_custom'} = 1; # make sure this never goes away
return $self;
}
BEGIN {
*objectify = \&Math::BigInt::objectify;
# to allow Math::BigFloat::Subclass::bgcd( ... ) style calls
*bgcd = \&Math::BigFloat::bgcd;
*blcm = \&Math::BigFloat::blcm;
}
1;
......@@ -5,7 +5,7 @@ package Math::BigInt::BareCalc;