Commit bd15764c authored by Lucas Kanashiro's avatar Lucas Kanashiro

Imported Upstream version 1.9997

parent 0d6b4aa1
......@@ -1201,6 +1201,9 @@ Math::BigInt:
* Stop $x -> bmodpow(1, 1) from failing when $x is large (Peter John Acklam)
(Closes: RT#62949).
##############################################################################
The changes are now grouped by distribution.
2011-01-29 v1.99_05 pjacklam
* Fix typos (reminder -> remainder etc.) (Peter John Acklam)
* Fix Math::BigInt::Calc::_num returning NaN, not Inf, when it overflowed
......@@ -1268,9 +1271,88 @@ Math::BigInt:
are known. (Peter John Acklam)
2014-04-03 v1.9993 pjacklam
* Synchronise with blead perl. For a list of recent changes, see
http://perl5.git.perl.org/perl.git/history/HEAD:/dist/Math-BigInt
* Removed examples/hailstone.pl which required the obsolete Math::Big
BUGS
* Add reference to CPAN RT for the Math-BigInt distro.
CHANGES
* Add recent changes.
examples/hailstone.pl
* Remove this file as it doesn't seem to be working.
lib/Math/BigFloat.pm
* Correct spelling errors.
* Reformat code to avoid long lines.
* Improve POD formatting.
* Add meta-documentation (CPAN ratings, CPAN testers matrix, etc.)
* Add the bint() method.
lib/Math/BigInt.pm
* Correct spelling errors.
* Reformat code to avoid long lines.
* Improve POD formatting.
* Add meta-documentation (CPAN ratings, CPAN testers matrix, etc.)
* Add the bint() method.
* Remove references to the obsolete Math::Big
lib/Math/BigInt/Calc.pm
* Correct spelling errors.
* Added meta-documentation (CPAN ratings, CPAN testers matrix, etc.)
lib/Math/BigInt/CalcEmu.pm
* Correct spelling errors.
* Improve POD formatting.
* Add meta-documentation (CPAN ratings, CPAN testers matrix, etc.)
* Remove references to Math::BigInt::BitVect, which is no longer on CPAN.
Makefile.PL
* Remove code that checks for compatible versions of distributions that
depend on Math-BigInt. Such checking should be done in the distributions
that depend on Math-BigInt, not in Math-BigInt itself.
NEW
* This file now only refers to the change log.
t/bigfltpm.inc
* Add tests for fint().
t/bigintpm.inc
* Add tests for int().
t/upgrade.inc
* Add tests for int().
t/*.t
* Increment test counts as needed for the new tests in the t/*.inc files.
inc/Module/Install*
* Upgrade bundled Module::Install from version 1.01 to version 1.08.
2015-08-10 v1.9994 pjacklam
CHANGES
* Add recent changes.
lib/Math/BigFloat.pm
* Fix blog() which sometimes returns incorrect result.
* bdiv() in list context now returns the integer quotient and the remainder.
t/bigfltpm.inc
* Modify tests for blog() in list context.
t/biglog.t
* Change incorrect use of ok() to is().
t/upgrade.inc
* Modify tests for blog() in list context.
inc/Module/Install*
* Upgrade bundled Module::Install from version 1.08 to version 1.16.
2015-08-11 v1.9995 pjacklam
CHANGES
* Move changes that were incorrectly reported as being for the release 1.9994
when they were in fact for release 1.9993.
* Add changes both for release 1.9994 and 1.9995.
lib/Math/BigInt.pm
* Break lines to avoid lines with more than 80 characters.
* Improve objectify() for better handling of subclasses.
2015-08-12 v1.9996 pjacklam
CHANGES
* Add recent changes.
* Use present tense in change descriptions.
lib/Math/BigInt.pm
* Change incorrect use of ok() to is() in example.
2015-08-12 v1.9997 pjacklam
CHANGES
* Add recent changes.
t/bigintpm.inc
* Correct spelling errors.
t/upgrade.inc
* Correct spelling errors.
Please send us test-reports, your experiences with this and your ideas - we love
to hear about our work!
......
......@@ -4,7 +4,7 @@
"Original code by Mark Biggar, overloaded interface by Ilya Zakharevich., Tels <nospam-abuse@bloodgate.com>"
],
"dynamic_config" : 1,
"generated_by" : "ExtUtils::MakeMaker version 6.94, CPAN::Meta::Converter version 2.140640",
"generated_by" : "ExtUtils::MakeMaker version 7.04, CPAN::Meta::Converter version 2.150005",
"license" : [
"perl_5"
],
......@@ -38,5 +38,6 @@
}
},
"release_status" : "stable",
"version" : "1.9993"
"version" : "1.9997",
"x_serialization_backend" : "JSON::PP version 2.27300"
}
......@@ -8,7 +8,7 @@ build_requires:
configure_requires:
ExtUtils::MakeMaker: '0'
dynamic_config: 1
generated_by: 'ExtUtils::MakeMaker version 6.94, CPAN::Meta::Converter version 2.140640'
generated_by: 'ExtUtils::MakeMaker version 7.04, CPAN::Meta::Converter version 2.150005'
license: perl
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.4.html
......@@ -20,4 +20,5 @@ no_index:
- inc
requires:
perl: '5.006002'
version: '1.9993'
version: '1.9997'
x_serialization_backend: 'CPAN::Meta::YAML version 0.016'
For the list of recent changes, see
For the list of recent changes see the end of the CHANGES file. Also see
http://perl5.git.perl.org/perl.git/history/HEAD:/dist/Math-BigInt
This file contains message digests of all files listed in MANIFEST,
signed via the Module::Signature module, version 0.73.
signed via the Module::Signature module, version 0.79.
To verify the content in this distribution, first make sure you have
Module::Signature installed, then type:
......@@ -16,7 +16,7 @@ Hash: SHA1
SHA1 f6ef98e8f3f6a4f670d569f279ef5a3c05c16d0c BENCHMARK
SHA1 d681b992c9e027633a59fbd52530805ee4e1621c BUGS
SHA1 05f7c590cb00bfbea30be2aa5c6276e65ec095a1 CHANGES
SHA1 378be01aa21fb9c800d26ee6220aeaeb395f75db CHANGES
SHA1 f27c8bd98e754f96c9825fa6ce9f1244c93bdbe6 CREDITS
SHA1 bc2db74538d3acd53f71b5512a144fe18c253ecd GOALS
SHA1 fe61299e80a1dca48fbaa33f0869e3238ec07c70 HISTORY
......@@ -24,27 +24,27 @@ SHA1 c42565ad26cdf91502bacf19a4f7080e63c51fe2 INSTALL
SHA1 d6a6c30ee6d9ba6b9afab8bbf6a25e1b23c744e0 LICENSE
SHA1 43408348b400ef1d910a18feab394817e343cc86 MANIFEST
SHA1 86df44fbe1ea7a68897113f0e327d0f0c25b91e3 MANIFEST.SKIP
SHA1 1e0a1155f4e92ff56e10551124cc61ababc6f274 META.json
SHA1 994883693277174208f3ef92b7cb323e8ea0db66 META.yml
SHA1 7ec6e161448d603d2b089c8673f9f0fd5630bc90 META.json
SHA1 b9755c48a5bcf63579bcab506dc7531dad600441 META.yml
SHA1 ae1e2767f1988a537d4a64fc84a07587cbca2ef5 Makefile.PL
SHA1 a299af68b43c7cdb7c930275e007a219bcab8be9 NEW
SHA1 bcb63898d70e8624bf75b6ed87089c2ab0414b14 NEW
SHA1 481f5827752d2100914db1eaeb60bf0bbd13529e README
SHA1 f1500916b488220b707bc10a0388d7dbcfd52e99 TODO
SHA1 c2bbe82659480de8710b9e64a62d47b64dddd2d2 examples/1000.txt
SHA1 fe55e27b4791656d36a6c9548280746de7003be5 examples/bigprimes.pl
SHA1 8ca42793d8769ec8d0928f11c30f38d96dd54efb examples/prime.pl
SHA1 dc13ce0dbb488a5de81c3f6519ee31acda17397a inc/Module/Install.pm
SHA1 91c20cbda8ca41b4e8f9e0390faff635c2ebe839 inc/Module/Install/Base.pm
SHA1 eaf50ccbacecb797f0527deb0221c8264f6c8bd8 inc/Module/Install/Can.pm
SHA1 363c8931cc183444907684b71d6a379e4fc8edcb inc/Module/Install/Fetch.pm
SHA1 26ae1c0f5f352037b560414f216d7e3ac682f936 inc/Module/Install/Makefile.pm
SHA1 ff97eb025b44c343d026c2a56a73d50c65319e95 inc/Module/Install/Metadata.pm
SHA1 4c5ce519d404e242418f51dfe761287469e18e3a inc/Module/Install/Win32.pm
SHA1 47a52cf8719a283c0efa2edab0088b5d67e0f23a inc/Module/Install/WriteAll.pm
SHA1 a652347eaf88e4119e4f09c0e66bf2848e6a5def lib/Math/BigFloat.pm
SHA1 9e2a90ffbc9d895142cad22fbf7599746a5ba3cb lib/Math/BigInt.pm
SHA1 a7f41aa75281e17489a2f6d15c267ab005fdd5c7 lib/Math/BigInt/Calc.pm
SHA1 fc9464adbd4eb931f92811447333ddc6cf2b0a3b lib/Math/BigInt/CalcEmu.pm
SHA1 bce3c51bb369419603298064b78e14077b93af66 inc/Module/Install.pm
SHA1 fe220f215f645500ce8f14ff5e19d9a28692af56 inc/Module/Install/Base.pm
SHA1 b56ed8e42c600e08007d152cf0b1438a7c3b7f6e inc/Module/Install/Can.pm
SHA1 99c531a17a67ce5250df2ae151cc48c80d914cde inc/Module/Install/Fetch.pm
SHA1 76efdca3603159e0ae0e18f19fe72a0211a69529 inc/Module/Install/Makefile.pm
SHA1 2e33e87882d60db3913da6284dd5295e5315e18a inc/Module/Install/Metadata.pm
SHA1 c830b819e61bda5eca077c6291293bba61b3b9f2 inc/Module/Install/Win32.pm
SHA1 cb52b9d6f88d512d448a6f35ed0af0d1201a134b inc/Module/Install/WriteAll.pm
SHA1 b47ff4e2795d341a730d67da7f20521579c1deed lib/Math/BigFloat.pm
SHA1 9677dcde0af6adb9ec888da7af2d5eec58798c42 lib/Math/BigInt.pm
SHA1 41199b85065c6435bf562c9ff81a9284ede0ce8b lib/Math/BigInt/Calc.pm
SHA1 0a7d7ef4133281c73e64322e78b8200b5bd4919e lib/Math/BigInt/CalcEmu.pm
SHA1 a2d393f9d265801f8ef022725d03f83b616b2fe1 t/00sig.t
SHA1 32b73052135171974d5c522f0dee665a03dacdbd t/01load.t
SHA1 02ef05af53cb7378452590324bb21dfe61f44069 t/02pod.t
......@@ -59,13 +59,13 @@ SHA1 16d36aa915f9d6e86ec3e4f4e05ef26c6129399d t/bare_mbf.t
SHA1 da1d61b785022c275d7d17f62aa6dfcdf1ddadaa t/bare_mbi.t
SHA1 97fb1db80aeb4ab007e2260d35329e149edf5e05 t/bare_mif.t
SHA1 333a425247b4e276696210a6322b815a0f55f5ab t/big_pi_e.t
SHA1 e6bb2aea2f026016848db9ca96507c4ca4e3d265 t/bigfltpm.inc
SHA1 27da8d84b12593dbc8350efa6b43339a05d344ef t/bigfltpm.inc
SHA1 9537400817c028f2282e3c085796ecbded0ccb66 t/bigfltpm.t
SHA1 b3ceebc429c05bce95347575d28348306dbcfcc8 t/bigintc.t
SHA1 d5d419d73cc52371ba3487895fd49f793ffe4d0c t/bigintpm.inc
SHA1 03927c64235f9aa1f1f373bd71328ce7c9afdfb5 t/bigintpm.inc
SHA1 73ac3701a1116b1831c871153c836f618a60f4d7 t/bigintpm.t
SHA1 cb07d195c20eb306088eeacccc2c7475f267446c t/bigints.t
SHA1 5bdf82ef7085b97caa496bfc71ab1fbfe48ef9e8 t/biglog.t
SHA1 4e27fc0056d6455d278c0d38f5fe7f3c9a57fbe8 t/biglog.t
SHA1 da260b6e02b220868fc7b4c0f87569299402fbf7 t/bigroot.t
SHA1 2ed03baf88a7d868706605bada7874123f99eded t/calling.t
SHA1 c1f7b6840e772f2b6d4f8dbea4c28aaa675c9b17 t/config.t
......@@ -96,7 +96,7 @@ SHA1 3717645c60b533355006f3966f36c341efea24e7 t/sub_mbf.t
SHA1 3d03b0a0970abc3b27d8b0f20877213c7f3ea87d t/sub_mbi.t
SHA1 a9d994551c5ca127c11f5cdd1d8df1d93972c72c t/sub_mif.t
SHA1 22c563a6879c94ce7c8eb72c645f2e374837c34e t/trap.t
SHA1 888eb4cba20a5f809458a05d7a078493a5ff07d4 t/upgrade.inc
SHA1 73899d40cc0e2f0cdf833ba60cd977da46e626f8 t/upgrade.inc
SHA1 3256f1ecdee8a1aafdcc6142362e815e565e3bff t/upgrade.t
SHA1 e9019081ff5c07957e45619010c62a54472d8508 t/upgrade2.t
SHA1 49183118717b8b90e498b6d7b1ac0aa0e4d85894 t/upgradef.t
......@@ -110,11 +110,11 @@ SHA1 1d0fbaa1a15cd095c4499a70886a40f1a2a6c7a5 t/with_sub.t
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
iQEcBAEBAgAGBQJTPotCAAoJEGcmPl2fr166SGgH/RjNe/223B16WOfwNgm2lPhu
MRB3+d6x9O8ceSF9aL9UlcDaoazgDik75zNSuJZrDt+wButpT0UwVzWx/UI8F1Fz
D9f0OIngPyQXuyJM57/85UbJy1ApKIKs4+mzCb9NHHJwLxcXJq4R9rnVtOWkHC4a
RxIvtrnG911GmO0BqrRtYI15MQ90VzHCoAY3gID90s9yxmHEA5h6GCTn+MyCRE0e
ZDCecSlKO9nXkPTOxL574iAhOl71TQTe6wjcBZklw7BsZc+NP/WodV0RoKh7cE5g
hRnlGlqaLRr3a1y/9hTsfv3of5XTlqngwWcfVcHYVyQFPC6+cGf15hVe8K5D/ZE=
=7Uk/
iQEcBAEBAgAGBQJVycQvAAoJEGcmPl2fr166zz8H/jIz/u+YMUUhhcwupf66kBpd
RjxR761QnAYouH/4Z74sPU2yGXGHhBpSC+q5S5j8Fp7Gdytqji8Irg58DXbyn+w8
/G6ki0QChse32C1Qqz+w65+6PYoAnDGao8veOc8zuk+a5ZI5ndIfKj/ZPewPh5Cy
VkD+u4byIVmZJIi0yOHnhIsl/BXBd/Kg44Q3Ogu++y0PdeKv3BaLXHbIUxArYiiL
IiU+ZynWHuPegIpGpaVmV4fi4LpHcwz7Xt9Y8hsDsLlQJW5/jrzPSlcJxvMVNvzL
vMcS1ZdqOJRgkOIFbdDvhtN4p7iM/MNLIqGTx1T0eUyHKYTzWRWGmjRM83TdGV0=
=3FDP
-----END PGP SIGNATURE-----
......@@ -17,7 +17,7 @@ package Module::Install;
# 3. The ./inc/ version of Module::Install loads
# }
use 5.005;
use 5.006;
use strict 'vars';
use Cwd ();
use File::Find ();
......@@ -31,7 +31,7 @@ BEGIN {
# This is not enforced yet, but will be some time in the next few
# releases once we can make sure it won't clash with custom
# Module::Install extensions.
$VERSION = '1.08';
$VERSION = '1.16';
# Storage for the pseudo-singleton
$MAIN = undef;
......@@ -156,10 +156,10 @@ END_DIE
sub autoload {
my $self = shift;
my $who = $self->_caller;
my $cwd = Cwd::cwd();
my $cwd = Cwd::getcwd();
my $sym = "${who}::AUTOLOAD";
$sym->{$cwd} = sub {
my $pwd = Cwd::cwd();
my $pwd = Cwd::getcwd();
if ( my $code = $sym->{$pwd} ) {
# Delegate back to parent dirs
goto &$code unless $cwd eq $pwd;
......@@ -239,7 +239,7 @@ sub new {
# ignore the prefix on extension modules built from top level.
my $base_path = Cwd::abs_path($FindBin::Bin);
unless ( Cwd::abs_path(Cwd::cwd()) eq $base_path ) {
unless ( Cwd::abs_path(Cwd::getcwd()) eq $base_path ) {
delete $args{prefix};
}
return $args{_self} if $args{_self};
......@@ -338,7 +338,7 @@ sub find_extensions {
if ( $subpath eq lc($subpath) || $subpath eq uc($subpath) ) {
my $content = Module::Install::_read($subpath . '.pm');
my $in_pod = 0;
foreach ( split //, $content ) {
foreach ( split /\n/, $content ) {
$in_pod = 1 if /^=\w/;
$in_pod = 0 if /^=cut/;
next if ($in_pod || /^=cut/); # skip pod text
......@@ -378,6 +378,7 @@ eval( $] >= 5.006 ? <<'END_NEW' : <<'END_OLD' ); die $@ if $@;
sub _read {
local *FH;
open( FH, '<', $_[0] ) or die "open($_[0]): $!";
binmode FH;
my $string = do { local $/; <FH> };
close FH or die "close($_[0]): $!";
return $string;
......@@ -386,6 +387,7 @@ END_NEW
sub _read {
local *FH;
open( FH, "< $_[0]" ) or die "open($_[0]): $!";
binmode FH;
my $string = do { local $/; <FH> };
close FH or die "close($_[0]): $!";
return $string;
......@@ -416,6 +418,7 @@ eval( $] >= 5.006 ? <<'END_NEW' : <<'END_OLD' ); die $@ if $@;
sub _write {
local *FH;
open( FH, '>', $_[0] ) or die "open($_[0]): $!";
binmode FH;
foreach ( 1 .. $#_ ) {
print FH $_[$_] or die "print($_[0]): $!";
}
......@@ -425,6 +428,7 @@ END_NEW
sub _write {
local *FH;
open( FH, "> $_[0]" ) or die "open($_[0]): $!";
binmode FH;
foreach ( 1 .. $#_ ) {
print FH $_[$_] or die "print($_[0]): $!";
}
......@@ -434,7 +438,7 @@ END_OLD
# _version is for processing module versions (eg, 1.03_05) not
# Perl versions (eg, 5.8.1).
sub _version ($) {
sub _version {
my $s = shift || 0;
my $d =()= $s =~ /(\.)/g;
if ( $d >= 2 ) {
......@@ -450,12 +454,12 @@ sub _version ($) {
return $l + 0;
}
sub _cmp ($$) {
sub _cmp {
_version($_[1]) <=> _version($_[2]);
}
# Cloned from Params::Util::_CLASS
sub _CLASS ($) {
sub _CLASS {
(
defined $_[0]
and
......
......@@ -4,7 +4,7 @@ package Module::Install::Base;
use strict 'vars';
use vars qw{$VERSION};
BEGIN {
$VERSION = '1.08';
$VERSION = '1.16';
}
# Suspend handler for "redefined" warnings
......
......@@ -8,7 +8,7 @@ use Module::Install::Base ();
use vars qw{$VERSION @ISA $ISCORE};
BEGIN {
$VERSION = '1.08';
$VERSION = '1.16';
@ISA = 'Module::Install::Base';
$ISCORE = 1;
}
......
......@@ -6,7 +6,7 @@ use Module::Install::Base ();
use vars qw{$VERSION @ISA $ISCORE};
BEGIN {
$VERSION = '1.08';
$VERSION = '1.16';
@ISA = 'Module::Install::Base';
$ISCORE = 1;
}
......
......@@ -8,7 +8,7 @@ use Fcntl qw/:flock :seek/;
use vars qw{$VERSION @ISA $ISCORE};
BEGIN {
$VERSION = '1.08';
$VERSION = '1.16';
@ISA = 'Module::Install::Base';
$ISCORE = 1;
}
......@@ -133,7 +133,7 @@ sub makemaker_args {
return $args;
}
# For mm args that take multiple space-seperated args,
# For mm args that take multiple space-separated args,
# append an argument to the current list.
sub makemaker_append {
my $self = shift;
......
......@@ -6,7 +6,7 @@ use Module::Install::Base ();
use vars qw{$VERSION @ISA $ISCORE};
BEGIN {
$VERSION = '1.08';
$VERSION = '1.16';
@ISA = 'Module::Install::Base';
$ISCORE = 1;
}
......@@ -347,7 +347,7 @@ sub name_from {
^ \s*
package \s*
([\w:]+)
\s* ;
[\s|;]*
/ixms
) {
my ($name, $module_name) = ($1, $1);
......@@ -705,7 +705,7 @@ sub _write_mymeta_data {
my @yaml = Parse::CPAN::Meta::LoadFile('META.yml');
my $meta = $yaml[0];
# Overwrite the non-configure dependency hashs
# Overwrite the non-configure dependency hashes
delete $meta->{requires};
delete $meta->{build_requires};
delete $meta->{recommends};
......
......@@ -6,7 +6,7 @@ use Module::Install::Base ();
use vars qw{$VERSION @ISA $ISCORE};
BEGIN {
$VERSION = '1.08';
$VERSION = '1.16';
@ISA = 'Module::Install::Base';
$ISCORE = 1;
}
......
......@@ -6,7 +6,7 @@ use Module::Install::Base ();
use vars qw{$VERSION @ISA $ISCORE};
BEGIN {
$VERSION = '1.08';
$VERSION = '1.16';
@ISA = qw{Module::Install::Base};
$ISCORE = 1;
}
......
......@@ -12,7 +12,7 @@ package Math::BigFloat;
# _a : accuracy
# _p : precision
$VERSION = '1.9993';
$VERSION = '1.9997';
require 5.006002;
require Exporter;
......@@ -1498,6 +1498,10 @@ sub _log_10
}
$l_2->bmul($twos); # * -2 => subtract, * 2 => add
}
else
{
undef $l_2;
}
$self->_log($x,$scale); # need to do the "normal" way
$x->badd($l_10) if defined $l_10; # correct it by ln(10)
......@@ -1895,6 +1899,7 @@ sub bdiv
{
if ($y_not_one)
{
$x -> bint();
$rem->bmod($y,@params); # copy already done
}
if ($fallback)
......
This diff is collapsed.
......@@ -4,7 +4,7 @@ use 5.006002;
use strict;
# use warnings; # do not use warnings for older Perls
our $VERSION = '1.9993';
our $VERSION = '1.9997';
# Package to store unsigned big integers in decimal and do math with them
......
......@@ -5,7 +5,7 @@ use strict;
# use warnings; # do not use warnings for older Perls
use vars qw/$VERSION/;
$VERSION = '1.9991';
$VERSION = '1.9997';
package Math::BigInt;
......
......@@ -1406,8 +1406,8 @@ NaNmul:-inf:NaN
&fdiv-list
0:0:NaN,NaN
0:1:0,0
9:4:2.25,1
9:5:1.8,4
9:4:2,1
9:5:1,4
# bug in v1.74 with bdiv in list context, when $y is 1 or -1
2.1:-1:-2.1,0
2.1:1:2.1,0
......
......@@ -1135,7 +1135,7 @@ abc:abc:NaN
+1:+32:4294967296
+1:+48:281474976710656
+8:-2:NaN
# excercise base 10
# exercise base 10
+12345:4:10:123450000
-1234:0:10:-1234
+1234:0:10:1234
......@@ -1153,7 +1153,7 @@ abc:abc:NaN
+4294967296:+32:1
+281474976710656:+48:1
+2:-2:NaN
# excercise base 10
# exercise base 10
-1234:0:10:-1234
+1234:0:10:1234
+200:2:10:2
......@@ -1585,7 +1585,7 @@ inf:0:inf,inf
96969696969696969696969696969678787878626262626262626262626262:484848484848484848484848486666666666666689898989898989898989:199,484848484848484848484848123012121211954972727272727272727451
# bug in v1.76
1267650600228229401496703205375:1267650600228229401496703205376:0,1267650600228229401496703205375
# excercise shortcut for numbers of the same length in div
# exercise shortcut for numbers of the same length in div
999999999999999999999999999999999:999999999999999999999999999999999:1,0
999999999999999999999999999999999:888888888888888888888888888888888:1,111111111111111111111111111111111
999999999999999999999999999999999:777777777777777777777777777777777:1,222222222222222222222222222222222
......
......@@ -46,17 +46,17 @@ $cl = "Math::BigFloat";
# some alarm()?
# this triggers the calculation and caching of ln(2):
ok ($cl->new(5)->blog(undef,71),
is ($cl->new(5)->blog(undef,71),
'1.6094379124341003746007593332261876395256013542685177219126478914741790');
# if the cache was correct, we should get this result, fast:
ok ($cl->new(2)->blog(undef,71),
is ($cl->new(2)->blog(undef,71),
'0.69314718055994530941723212145817656807550013436025525412068000949339362');
ok ($cl->new(10)->blog(undef,71),
'2.3025850929940456840179914546843642076011014886287729760333279009675726');
is ($cl->new(11)->blog(undef,71),
'2.3978952727983705440619435779651292998217068539374171752185677091305736');
ok ($cl->new(21)->blog(undef,71),
is ($cl->new(21)->blog(undef,71),
'3.0445224377234229965005979803657054342845752874046106401940844835750742');
#############################################################################
......@@ -65,52 +65,52 @@ ok ($cl->new(21)->blog(undef,71),
# Don't attempt to run them with older versions. You are warned.
# $x < 0 => NaN
ok ($cl->new(-2)->blog(), 'NaN');
ok ($cl->new(-1)->blog(), 'NaN');
ok ($cl->new(-10)->blog(), 'NaN');
ok ($cl->new(-2,2)->blog(), 'NaN');
is ($cl->new(-2)->blog(), 'NaN');
is ($cl->new(-1)->blog(), 'NaN');
is ($cl->new(-10)->blog(), 'NaN');
is ($cl->new(-2,2)->blog(), 'NaN');
my $ten = $cl->new(10)->blog();
# 10 is cached (up to 75 digits)
ok ($cl->new(10)->blog(), '2.302585092994045684017991454684364207601');
is ($cl->new(10)->blog(), '2.302585092994045684017991454684364207601');
# 0.1 is using the cached value for log(10), too
ok ($cl->new(0.1)->blog(), -$ten);
ok ($cl->new(0.01)->blog(), -$ten * 2);
ok ($cl->new(0.001)->blog(), -$ten * 3);
ok ($cl->new(0.0001)->blog(), -$ten * 4);
is ($cl->new(0.1)->blog(), -$ten);
is ($cl->new(0.01)->blog(), -$ten * 2);
is ($cl->new(0.001)->blog(), -$ten * 3);
is ($cl->new(0.0001)->blog(), -$ten * 4);
# also cached
ok ($cl->new(2)->blog(), '0.6931471805599453094172321214581765680755');
ok ($cl->new(4)->blog(), $cl->new(2)->blog * 2);
is ($cl->new(2)->blog(), '0.6931471805599453094172321214581765680755');
is ($cl->new(4)->blog(), $cl->new(2)->blog * 2);
# These are still slow, so do them only to 10 digits
ok ($cl->new('0.2')->blog(undef,10), '-1.609437912');
ok ($cl->new('0.3')->blog(undef,10), '-1.203972804');
ok ($cl->new('0.4')->blog(undef,10), '-0.9162907319');
ok ($cl->new('0.5')->blog(undef,10), '-0.6931471806');
ok ($cl->new('0.6')->blog(undef,10), '-0.5108256238');
ok ($cl->new('0.7')->blog(undef,10), '-0.3566749439');
ok ($cl->new('0.8')->blog(undef,10), '-0.2231435513');
ok ($cl->new('0.9')->blog(undef,10), '-0.1053605157');
is ($cl->new('0.2')->blog(undef,10), '-1.609437912');
is ($cl->new('0.3')->blog(undef,10), '-1.203972804');
is ($cl->new('0.4')->blog(undef,10), '-0.9162907319');
is ($cl->new('0.5')->blog(undef,10), '-0.6931471806');
is ($cl->new('0.6')->blog(undef,10), '-0.5108256238');
is ($cl->new('0.7')->blog(undef,10), '-0.3566749439');
is ($cl->new('0.8')->blog(undef,10), '-0.2231435513');
is ($cl->new('0.9')->blog(undef,10), '-0.1053605157');
ok ($cl->new('9')->blog(undef,10), '2.197224577');
is ($cl->new('9')->blog(undef,10), '2.197224577');
ok ($cl->new('10')->blog(10,10), '1.000000000');
ok ($cl->new('20')->blog(20,10), '1.000000000');
ok ($cl->new('100')->blog(100,10), '1.000000000');
is ($cl->new('10')->blog(10,10), '1.000000000');
is ($cl->new('20')->blog(20,10), '1.000000000');
is ($cl->new('100')->blog(100,10), '1.000000000');
ok ($cl->new('100')->blog(10,10), '2.000000000'); # 10 ** 2 == 100
ok ($cl->new('400')->blog(20,10), '2.000000000'); # 20 ** 2 == 400
is ($cl->new('100')->blog(10,10), '2.000000000'); # 10 ** 2 == 100
is ($cl->new('400')->blog(20,10), '2.000000000'); # 20 ** 2 == 400
ok ($cl->new('4')->blog(2,10), '2.000000000'); # 2 ** 2 == 4
ok ($cl->new('16')->blog(2,10), '4.000000000'); # 2 ** 4 == 16
is ($cl->new('4')->blog(2,10), '2.000000000'); # 2 ** 2 == 4
is ($cl->new('16')->blog(2,10), '4.000000000'); # 2 ** 4 == 16
ok ($cl->new('1.2')->bpow('0.3',10), '1.056219968');
ok ($cl->new('10')->bpow('0.6',10), '3.981071706');
is ($cl->new('1.2')->bpow('0.3',10), '1.056219968');
is ($cl->new('10')->bpow('0.6',10), '3.981071706');
# blog should handle bigint input
is (Math::BigFloat::blog(Math::BigInt->new(100),10), 2, "blog(100)");
......
......@@ -567,7 +567,7 @@ abc:abc:NaN
+1:+32:4294967296
+1:+48:281474976710656
+8:-2:NaN
# excercise base 10
# exercise base 10
+12345:4:10:123450000
-1234:0:10:-1234
+1234:0:10:1234
......@@ -834,15 +834,15 @@ NaNmul:-inf:NaN
-4095:-4095:1,0
4095:-4095:-1,0
-4095:4095:-1,0
123:2:61.5,1
9:5:1.8,4
9:4:2.25,1
123:2:61,1
9:5:1,4
9:4:2,1
# inf handling and general remainder
5:8:0.625,5
5:8:0,5
0:8:0,0
11:2:5.5,1
11:-2:-5.5,-1
-11:2:-5.5,1
11:2:5,1
11:-2:-5,-1
-11:2:-5,1
# see table in documentation in MBI
0:inf:0,0
0:-inf:0,0
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment