Hello community, here is the log from the commit of package perl-Math-BigInt for openSUSE:Factory checked in at 2017-02-15 10:06:48 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/perl-Math-BigInt (Old) and /work/SRC/openSUSE:Factory/.perl-Math-BigInt.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "perl-Math-BigInt" Changes: -------- --- /work/SRC/openSUSE:Factory/perl-Math-BigInt/perl-Math-BigInt.changes 2017-01-22 00:49:02.766033689 +0100 +++ /work/SRC/openSUSE:Factory/.perl-Math-BigInt.new/perl-Math-BigInt.changes 2017-02-15 10:06:49.616636155 +0100 @@ -1,0 +2,25 @@ +Sat Feb 11 06:04:38 UTC 2017 - co...@suse.com + +- updated to 1.999809 + see /usr/share/doc/packages/perl-Math-BigInt/CHANGES + + 2017-02-10 v1.999809 pjacklam + + * When a new method is added to Math::BigInt or Math::BigFloat, and this new + method requires a new backend library method, die with a suitable error + message if the installed backend library does not support this new method. + The error message says that the method requires a newer version of the + backend library. + + * Fix typos in Math::BigFloat and Math::BigInt. + + * Add bfib() and blucas() to Math::BigInt. They return Fibonacci and Lucas + numbers, respectively. The actual computation of the numbers is done by the + backend library. Documented both methods in POD. Add test files bfib-mbi.t + and blucas-mbi.t. + + * Add _fib() and _lucas() to Math::BigInt::Lib. They return Fibonacci and + Lucas numbers, respectively. Document both methods in POD. Add test files + author-lib-arithmetic-unary-_fib.t and author-lib-arithmetic-unary-_lucas.t. + +------------------------------------------------------------------- Old: ---- Math-BigInt-1.999808.tar.gz New: ---- Math-BigInt-1.999809.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ perl-Math-BigInt.spec ++++++ --- /var/tmp/diff_new_pack.trQSip/_old 2017-02-15 10:06:50.072571934 +0100 +++ /var/tmp/diff_new_pack.trQSip/_new 2017-02-15 10:06:50.076571370 +0100 @@ -17,7 +17,7 @@ Name: perl-Math-BigInt -Version: 1.999808 +Version: 1.999809 Release: 0 %define cpan_name Math-BigInt Summary: Arbitrary size integer/float math package ++++++ Math-BigInt-1.999808.tar.gz -> Math-BigInt-1.999809.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Math-BigInt-1.999808/CHANGES new/Math-BigInt-1.999809/CHANGES --- old/Math-BigInt-1.999808/CHANGES 2017-01-11 18:16:29.000000000 +0100 +++ new/Math-BigInt-1.999809/CHANGES 2017-02-10 12:01:15.000000000 +0100 @@ -1,3 +1,22 @@ +2017-02-10 v1.999809 pjacklam + + * When a new method is added to Math::BigInt or Math::BigFloat, and this new + method requires a new backend library method, die with a suitable error + message if the installed backend library does not support this new method. + The error message says that the method requires a newer version of the + backend library. + + * Fix typos in Math::BigFloat and Math::BigInt. + + * Add bfib() and blucas() to Math::BigInt. They return Fibonacci and Lucas + numbers, respectively. The actual computation of the numbers is done by the + backend library. Documented both methods in POD. Add test files bfib-mbi.t + and blucas-mbi.t. + + * Add _fib() and _lucas() to Math::BigInt::Lib. They return Fibonacci and + Lucas numbers, respectively. Document both methods in POD. Add test files + author-lib-arithmetic-unary-_fib.t and author-lib-arithmetic-unary-_lucas.t. + 2017-01-11 v1.999808 pjacklam * In Math::BigInt and Math::BigFloat, add methods bdfac() for double diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Math-BigInt-1.999808/MANIFEST new/Math-BigInt-1.999809/MANIFEST --- old/Math-BigInt-1.999808/MANIFEST 2017-01-11 19:39:22.000000000 +0100 +++ new/Math-BigInt-1.999809/MANIFEST 2017-02-10 12:06:49.000000000 +0100 @@ -66,8 +66,12 @@ t/author-lib-arithmetic-unary-_dfac.t t/author-lib-arithmetic-unary-_fac.dat t/author-lib-arithmetic-unary-_fac.t +t/author-lib-arithmetic-unary-_fib.dat +t/author-lib-arithmetic-unary-_fib.t t/author-lib-arithmetic-unary-_inc.dat t/author-lib-arithmetic-unary-_inc.t +t/author-lib-arithmetic-unary-_lucas.dat +t/author-lib-arithmetic-unary-_lucas.t t/author-lib-arithmetic-unary-_sqrt.dat t/author-lib-arithmetic-unary-_sqrt.t t/author-lib-bitwise-_and.dat @@ -133,6 +137,7 @@ t/bdstr-mbi.t t/bestr-mbf.t t/bestr-mbi.t +t/bfib-mbi.t t/big_pi_e.t t/bigfltpm.inc t/bigfltpm.t @@ -142,6 +147,7 @@ t/bigints.t t/biglog.t t/bigroot.t +t/blucas-mbi.t t/bnstr-mbf.t t/bnstr-mbi.t t/bsstr-mbf.t diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Math-BigInt-1.999808/META.json new/Math-BigInt-1.999809/META.json --- old/Math-BigInt-1.999808/META.json 2017-01-11 19:39:21.000000000 +0100 +++ new/Math-BigInt-1.999809/META.json 2017-02-10 12:06:49.000000000 +0100 @@ -39,6 +39,6 @@ } }, "release_status" : "stable", - "version" : "1.999808", + "version" : "1.999809", "x_serialization_backend" : "JSON::PP version 2.27400" } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Math-BigInt-1.999808/META.yml new/Math-BigInt-1.999809/META.yml --- old/Math-BigInt-1.999808/META.yml 2017-01-11 19:39:20.000000000 +0100 +++ new/Math-BigInt-1.999809/META.yml 2017-02-10 12:06:47.000000000 +0100 @@ -21,5 +21,5 @@ Math::Complex: '1.39' Test::More: '0.94' perl: '5.006001' -version: '1.999808' +version: '1.999809' x_serialization_backend: 'CPAN::Meta::YAML version 0.018' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Math-BigInt-1.999808/SIGNATURE new/Math-BigInt-1.999809/SIGNATURE --- old/Math-BigInt-1.999808/SIGNATURE 2017-01-11 19:42:51.000000000 +0100 +++ new/Math-BigInt-1.999809/SIGNATURE 2017-02-10 12:06:53.000000000 +0100 @@ -15,15 +15,15 @@ Hash: SHA1 SHA1 20104176cd4b0623c201cdb2c9583056898b2afc BUGS -SHA1 c9d01c8a0b967b6d7bcb167577cea683de289ad6 CHANGES +SHA1 427947bca6aaab32da506d0dff040b01c0cefb37 CHANGES SHA1 a40e6f05bfd2a3e0542cf9e4971b1d48100eb2fd CREDITS SHA1 8d0b726d78afa344fb12508e1b027079699570e4 GOALS SHA1 fe61299e80a1dca48fbaa33f0869e3238ec07c70 HISTORY SHA1 d7c83d8f89b92a3262a01eb2778d39402e77263a LICENSE -SHA1 010b8d09bcacc327cc1783c136128fe5a135bd6f MANIFEST +SHA1 66ec462f7cac003832200f3132b2426d5b1c4edd MANIFEST SHA1 86df44fbe1ea7a68897113f0e327d0f0c25b91e3 MANIFEST.SKIP -SHA1 ec72085ca73637be0747390379306cbaf6934f18 META.json -SHA1 ca7ec6499f5c0980861ea901a656e8aba89d4b48 META.yml +SHA1 84f0993213e2fbd080c9c66017e4e3d8825b14e5 META.json +SHA1 b2b0aa6dbb414625563c42f0e7411dd3f4e080c3 META.yml SHA1 64057848e0b32a6dc4666981c40443fad32197ff Makefile.PL SHA1 4e2191d1724e699862efc5350f480c8e02755112 NEW SHA1 813c62e6d3edd18b7b634765ecbd75b2cd6389a0 README @@ -31,11 +31,11 @@ SHA1 a8ffc7d3270e481c9d24603a74ba2c0f46cae0e3 examples/1000.txt SHA1 3295c03031e6a50199c1acc743a3f3276e6ae59d examples/bigprimes.pl SHA1 989bfc0ad145d0f42b1eb65e83d9de018a7ee150 examples/prime.pl -SHA1 601489d3b0245fdf569cb8d9906069d49c7cbf1c lib/Math/BigFloat.pm -SHA1 5fa26e901c52b04247b54b726772fbb851b9dd7a lib/Math/BigInt.pm -SHA1 f78149fb76d10aca19ca5c62c1d247d26728b961 lib/Math/BigInt/Calc.pm -SHA1 a0133bcbfe71d54739aaf2da8a3dafcb29c94ee6 lib/Math/BigInt/CalcEmu.pm -SHA1 22673ff709a3335376c76767324143de3c29f78b lib/Math/BigInt/Lib.pm +SHA1 707e4ea0932aab1bd3d8314b539344a20753446d lib/Math/BigFloat.pm +SHA1 3e54ce7b99815eaad5d0a27574ea3bbb7fca4e93 lib/Math/BigInt.pm +SHA1 ba034b5b2f2167bc9a16bf051282dcf394abe7c2 lib/Math/BigInt/Calc.pm +SHA1 40cfd23d1bbe9da59e0e42187aeb345c9e2ca97b lib/Math/BigInt/CalcEmu.pm +SHA1 b8ef5b71c4d65e813a096823dd5e67d936db8667 lib/Math/BigInt/Lib.pm SHA1 385cc7ed3bf3e6290640b9880445ca9a3dea629e t/00sig.t SHA1 062a7e33e6697b19e002cdb11f3c648fe6669139 t/01load.t SHA1 b2ed9206ca5b69ec3b8bbf850bf4b6dfde518e7e t/02pod.t @@ -91,8 +91,12 @@ SHA1 4ced5df6d99a24180efe48e9818b97966937e0b3 t/author-lib-arithmetic-unary-_dfac.t SHA1 0611b9f6f31bec9174d4cee4d20899e023feb0ca t/author-lib-arithmetic-unary-_fac.dat SHA1 8e2f461b24972926f9777d792d96b20e4793eea9 t/author-lib-arithmetic-unary-_fac.t +SHA1 0b68c69d88f0b52a80a5c9dbcc9c98a4e7fcb57c t/author-lib-arithmetic-unary-_fib.dat +SHA1 4f0bf6a7fcfce9e7c4bda59a2dcc60975a6265c7 t/author-lib-arithmetic-unary-_fib.t SHA1 cc89be7f70dd75c8fef0cbf6f0bc24c9bd4b5ba2 t/author-lib-arithmetic-unary-_inc.dat SHA1 ea13d6d205a217f2967c5cb0f42d57a971899583 t/author-lib-arithmetic-unary-_inc.t +SHA1 da063137e88f2212c3aa1efc54eb7a1628aaf0b0 t/author-lib-arithmetic-unary-_lucas.dat +SHA1 76bd647012a854ec7fe37e71711c24f169309d7c t/author-lib-arithmetic-unary-_lucas.t SHA1 945458ba0c81213b1e7ee6a277cc47e425108f3e t/author-lib-arithmetic-unary-_sqrt.dat SHA1 c635eaae7dc0bb20b244ee241a2d4cdf1ec6e25b t/author-lib-arithmetic-unary-_sqrt.t SHA1 fa4e6baa4542ce315a681a6da751a37751e39ca6 t/author-lib-bitwise-_and.dat @@ -158,6 +162,7 @@ SHA1 7e5d1349b113ad024efe066e42a50bc9ff595550 t/bdstr-mbi.t SHA1 08654f0fe1eb27ec069f403ce433ccb588f7a29f t/bestr-mbf.t SHA1 ed5547fcac28f575d1bbd2e3e5f6fe5f6146c321 t/bestr-mbi.t +SHA1 96bd46866ad45ceed4eedc1c33a3105ee1ae2bc5 t/bfib-mbi.t SHA1 e6bd71c0d21c7199106b5580e2fbd186b6b01d29 t/big_pi_e.t SHA1 709cef0e13fd2a85f007482877bfdcf42bf5f8d4 t/bigfltpm.inc SHA1 b79b49c9653b1ab538753a9857d3bd1dc134f1a0 t/bigfltpm.t @@ -167,13 +172,14 @@ SHA1 9aac2eda0e723298c8f9ddadffde39a8c16fb171 t/bigints.t SHA1 3f4bf6d2717d47117ab987cc6ff8d38991cdd383 t/biglog.t SHA1 128c6cb0ef562637e7b44bafa83188b058392392 t/bigroot.t +SHA1 aab5180a38420e248d2ca0b515dab55c342bee5a t/blucas-mbi.t SHA1 2f7b4a37d45938057e6faa5db808e1df7fb7f043 t/bnstr-mbf.t SHA1 a4344b91b9508dcb85645a4b87268f2c11576cae t/bnstr-mbi.t SHA1 8d5692fa1ab8b84bb816f83c0d51c409de8f13b5 t/bsstr-mbf.t SHA1 c97164e3ae794f8d2f141be42e5f7af4f2dd674b t/bsstr-mbi.t SHA1 dcaf0d82455c9a814da942383cbceb2da7ad3a4c t/calling-class-methods.t SHA1 63e873c5cdcccfb338fb9220d33904027865e9cf t/calling-instance-methods.t -SHA1 d3838262b3bd03e4e94648cc8961630c387106ac t/calling.t +SHA1 0b78fc72dafd67450fac6f35b8cd2ef312523fcd t/calling.t SHA1 c403d1c64ae6c3b803fc8cd0d10a1df15219057f t/config.t SHA1 af01ecfb6f43bb518c67185eb063c196e2dbdc48 t/const_mbf.t SHA1 17eb15c35392945a5b3ed2b711f7d166fca294de t/constant.t @@ -232,11 +238,11 @@ SHA1 0a82a7eb45e422b6fb8301400fdd98f8a3ec5886 t/with_sub.t -----BEGIN PGP SIGNATURE----- -iQEcBAEBAgAGBQJYdnvaAAoJEGcmPl2fr166wJYIAK6RbV7DdOaev1H9fZzgsDc9 -PDAZCq+aL3Z/GNR4Lz2XafFGk252q0NNOHZmSdrZYEiIMlg2Qr4RgAVHeYMQdjHO -ahLpKLyZpKRDWAR6qCTpgyg3+I95YY41biSG1xAQPEMsHjekEPWasfDmJ9HM2/y4 -jM7twYal/PR/eh0YCAk3DCPF0wxFuJkriXdKZ4szK0IVOfzzPfMeu0VlicsvuyWR -YDmJzww0En9ZdZaXxFN5huKlfo/Ps15JZyAn91G7o6SybhMqu9gnv868uUvh+AXz -CgtKRA/HQboG49jUmCUJc9Q6JEdnEvFUovj0HZGGJpyL3FEaEsMAVDcEn0+fmlg= -=9cSr +iQEcBAEBAgAGBQJYnZ7KAAoJEGcmPl2fr166Hy8H/ihoEd++XQ6mgj2tw71IEgTq +IyJoUAhd7YsXBB1lRbpq3uGKUifvY/BBtTShdp+eGOS/bd5SFtBavw0npyyrBMCI +wtDgH57B5lexpV0RW4irkQqM48sHWC74HXhc/Wv66d2q7k6Z+IOed+r4po3kGz9a +rVOC67Lu7d/8Cl0OoW6GSbwtMbzva7JyFT85Q8F1TLGxT7uuxiPLXq5+ky0OmEbz +tFwjUFLQK37zRawb0hbMJztnMYCg7KvfkWSyTtXjg+XT/+txXUP3udGULM/pywco +Xi4Su2I60Cn67NM5WX1tYNwvxU4ULsx6kJiesGvHuR5x6DQ7S4dmMHkeSnn5PHo= +=LUnS -----END PGP SIGNATURE----- diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Math-BigInt-1.999808/lib/Math/BigFloat.pm new/Math-BigInt-1.999809/lib/Math/BigFloat.pm --- old/Math-BigInt-1.999808/lib/Math/BigFloat.pm 2017-01-11 15:56:33.000000000 +0100 +++ new/Math-BigInt-1.999809/lib/Math/BigFloat.pm 2017-02-06 16:38:47.000000000 +0100 @@ -19,7 +19,7 @@ use Carp (); use Math::BigInt (); -our $VERSION = '1.999808'; +our $VERSION = '1.999809'; require Exporter; our @ISA = qw/Math::BigInt/; @@ -3232,7 +3232,6 @@ if (($x->{sign} ne '+') || # inf, NaN, <0 etc => NaN ($x->{_es} ne '+')); # digits after dot? - # use BigInt's bfac() for faster calc if (! $MBI->_is_zero($x->{_e})) { $x->{_m} = $MBI->_lsft($x->{_m}, $x->{_e}, 10); # change 12e1 to 120e0 $x->{_e} = $MBI->_zero(); # normalize @@ -3257,7 +3256,9 @@ if (($x->{sign} ne '+') || # inf, NaN, <0 etc => NaN ($x->{_es} ne '+')); # digits after dot? - # use BigInt's bdfac() for faster calc + Carp::croak("bdfac() requires a newer version of the $MBI library.") + unless $MBI->can('_dfac'); + if (! $MBI->_is_zero($x->{_e})) { $x->{_m} = $MBI->_lsft($x->{_m}, $x->{_e}, 10); # change 12e1 to 120e0 $x->{_e} = $MBI->_zero(); # normalize diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Math-BigInt-1.999808/lib/Math/BigInt/Calc.pm new/Math-BigInt-1.999809/lib/Math/BigInt/Calc.pm --- old/Math-BigInt-1.999808/lib/Math/BigInt/Calc.pm 2016-12-26 09:37:54.000000000 +0100 +++ new/Math-BigInt-1.999809/lib/Math/BigInt/Calc.pm 2017-02-06 16:38:37.000000000 +0100 @@ -7,7 +7,7 @@ use Carp; use Math::BigInt::Lib; -our $VERSION = '1.999808'; +our $VERSION = '1.999809'; our @ISA = ('Math::BigInt::Lib'); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Math-BigInt-1.999808/lib/Math/BigInt/CalcEmu.pm new/Math-BigInt-1.999809/lib/Math/BigInt/CalcEmu.pm --- old/Math-BigInt-1.999808/lib/Math/BigInt/CalcEmu.pm 2017-01-05 19:47:23.000000000 +0100 +++ new/Math-BigInt-1.999809/lib/Math/BigInt/CalcEmu.pm 2017-02-06 16:38:34.000000000 +0100 @@ -4,7 +4,7 @@ use strict; use warnings; -our $VERSION = '1.999808'; +our $VERSION = '1.999809'; package Math::BigInt; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Math-BigInt-1.999808/lib/Math/BigInt/Lib.pm new/Math-BigInt-1.999809/lib/Math/BigInt/Lib.pm --- old/Math-BigInt-1.999808/lib/Math/BigInt/Lib.pm 2017-01-05 19:47:20.000000000 +0100 +++ new/Math-BigInt-1.999809/lib/Math/BigInt/Lib.pm 2017-02-06 16:38:12.000000000 +0100 @@ -4,7 +4,7 @@ use strict; use warnings; -our $VERSION = '1.999808'; +our $VERSION = '1.999809'; use Carp; @@ -1405,6 +1405,100 @@ return $x; } +sub _lucas { + my ($class, $n) = @_; + + $n = $class -> _num($n) if ref $n; + + # In list context, use lucas(n) = lucas(n-1) + lucas(n-2) + + if (wantarray) { + my @y; + + push @y, $class -> _two(); + return @y if $n == 0; + + push @y, $class -> _one(); + return @y if $n == 1; + + for (my $i = 2 ; $i <= $n ; ++ $i) { + $y[$i] = $class -> _add($class -> _copy($y[$i - 1]), $y[$i - 2]); + } + + return @y; + } + + require Scalar::Util; + + # In scalar context use that lucas(n) = fib(n-1) + fib(n+1). + # + # Remember that _fib() behaves differently in scalar context and list + # context, so we must add scalar() to get the desired behaviour. + + return $class -> _two() if $n == 0; + + return $class -> _add(scalar $class -> _fib($n - 1), + scalar $class -> _fib($n + 1)); +} + +sub _fib { + my ($class, $n) = @_; + + $n = $class -> _num($n) if ref $n; + + # In list context, use fib(n) = fib(n-1) + fib(n-2) + + if (wantarray) { + my @y; + + push @y, $class -> _zero(); + return @y if $n == 0; + + push @y, $class -> _one(); + return @y if $n == 1; + + for (my $i = 2 ; $i <= $n ; ++ $i) { + $y[$i] = $class -> _add($class -> _copy($y[$i - 1]), $y[$i - 2]); + } + + return @y; + } + + # In scalar context use a fast algorithm that is much faster than the + # recursive algorith used in list context. + + my $cache = {}; + my $two = $class -> _two(); + my $fib; + + $fib = sub { + my $n = shift; + return $class -> _zero() if $n <= 0; + return $class -> _one() if $n <= 2; + return $cache -> {$n} if exists $cache -> {$n}; + + my $k = int($n / 2); + my $a = $fib -> ($k + 1); + my $b = $fib -> ($k); + my $y; + + if ($n % 2 == 1) { + # a*a + b*b + $y = $class -> _add($class -> _mul($class -> _copy($a), $a), + $class -> _mul($class -> _copy($b), $b)); + } else { + # (2*a - b)*b + $y = $class -> _mul($class -> _sub($class -> _mul( + $class -> _copy($two), $a), $b), $b); + } + + $cache -> {$n} = $y; + return $y; + }; + + return $fib -> ($n); +} + ############################################################################## ############################################################################## @@ -1657,6 +1751,18 @@ Return the least common multiple of OBJ1 and OBJ2. +=item CLASS-E<gt>_fib(OBJ) + +In scalar context, returns the nth Fibonacci number: _fib(0) returns 0, _fib(1) +returns 1, _fib(2) returns 1, _fib(3) returns 2 etc. In list context, returns +the Fibonacci numbers from F(0) to F(n): 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, ... + +=item CLASS-E<gt>_lucas(OBJ) + +In scalar context, returns the nth Lucas number: _lucas(0) returns 2, _lucas(1) +returns 1, _lucas(2) returns 3, etc. In list context, returns the Lucas numbers +from L(0) to L(n): 2, 1, 3, 4, 7, 11, 18, 29,47, 76, ... + =back =head3 Bitwise operators diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Math-BigInt-1.999808/lib/Math/BigInt.pm new/Math-BigInt-1.999809/lib/Math/BigInt.pm --- old/Math-BigInt-1.999808/lib/Math/BigInt.pm 2017-01-11 15:55:22.000000000 +0100 +++ new/Math-BigInt-1.999809/lib/Math/BigInt.pm 2017-02-10 10:34:43.000000000 +0100 @@ -20,7 +20,7 @@ use Carp (); -our $VERSION = '1.999808'; +our $VERSION = '1.999809'; our @ISA = qw(Exporter); our @EXPORT_OK = qw(objectify bgcd blcm); @@ -2718,16 +2718,131 @@ } sub bdfac { - # compute factorial number from $x, modify $x in place + # compute double factorial, modify $x in place my ($class, $x, @r) = ref($_[0]) ? (undef, @_) : objectify(1, @_); return $x if $x->modify('bdfac') || $x->{sign} eq '+inf'; # inf => inf return $x->bnan() if $x->{sign} ne '+'; # NaN, <0 etc => NaN + Carp::croak("bdfac() requires a newer version of the $CALC library.") + unless $CALC->can('_dfac'); + $x->{value} = $CALC->_dfac($x->{value}); $x->round(@r); } +sub bfib { + # compute Fibonacci number(s) + my ($class, $x, @r) = objectify(1, @_); + + Carp::croak("bfib() requires a newer version of the $CALC library.") + unless $CALC->can('_fib'); + + return $x if $x->modify('bfib'); + + # List context. + + if (wantarray) { + return () if $x -> is_nan(); + Carp::croak("bfib() can't return an infinitely long list of numbers") + if $x -> is_inf(); + + # Use the backend library to compute the first $x Fibonacci numbers. + + my @values = $CALC->_fib($x->{value}); + + # Make objects out of them. The last element in the array is the + # invocand. + + for (my $i = 0 ; $i < $#values ; ++ $i) { + my $fib = $class -> bzero(); + $fib -> {value} = $values[$i]; + $values[$i] = $fib; + } + + $x -> {value} = $values[-1]; + $values[-1] = $x; + + # If negative, insert sign as appropriate. + + if ($x -> is_neg()) { + for (my $i = 2 ; $i <= $#values ; $i += 2) { + $values[$i]{sign} = '-'; + } + } + + @values = map { $_ -> round(@r) } @values; + return @values; + } + + # Scalar context. + + else { + return $x if $x->modify('bdfac') || $x -> is_inf('+'); + return $x->bnan() if $x -> is_nan() || $x -> is_inf('-'); + + $x->{sign} = $x -> is_neg() && $x -> is_even() ? '-' : '+'; + $x->{value} = $CALC->_fib($x->{value}); + return $x->round(@r); + } +} + +sub blucas { + # compute Lucas number(s) + my ($class, $x, @r) = objectify(1, @_); + + Carp::croak("blucas() requires a newer version of the $CALC library.") + unless $CALC->can('_lucas'); + + return $x if $x->modify('blucas'); + + # List context. + + if (wantarray) { + return () if $x -> is_nan(); + Carp::croak("blucas() can't return an infinitely long list of numbers") + if $x -> is_inf(); + + # Use the backend library to compute the first $x Lucas numbers. + + my @values = $CALC->_lucas($x->{value}); + + # Make objects out of them. The last element in the array is the + # invocand. + + for (my $i = 0 ; $i < $#values ; ++ $i) { + my $lucas = $class -> bzero(); + $lucas -> {value} = $values[$i]; + $values[$i] = $lucas; + } + + $x -> {value} = $values[-1]; + $values[-1] = $x; + + # If negative, insert sign as appropriate. + + if ($x -> is_neg()) { + for (my $i = 2 ; $i <= $#values ; $i += 2) { + $values[$i]{sign} = '-'; + } + } + + @values = map { $_ -> round(@r) } @values; + return @values; + } + + # Scalar context. + + else { + return $x if $x -> is_inf('+'); + return $x->bnan() if $x -> is_nan() || $x -> is_inf('-'); + + $x->{sign} = $x -> is_neg() && $x -> is_even() ? '-' : '+'; + $x->{value} = $CALC->_lucas($x->{value}); + return $x->round(@r); + } +} + sub blsft { # (BINT or num_str, BINT or num_str) return BINT # compute x << y, base n, y >= 0 @@ -5177,6 +5292,74 @@ 2*4*6*...*$x. If C<$x> is an odd integer, returns the product of all positive, odd integers, i.e., 1*3*5*...*$x. +=item bfib() + + $F = $n->bfib(); # a single Fibonacci number + @F = $n->bfib(); # a list of Fibonacci numbers + +In scalar context, returns a single Fibonacci number. In list context, returns +a list of Fibonacci numbers. The invocand is the last element in the output. + +The Fibonacci sequence is defined by + + F(0) = 0 + F(1) = 1 + F(n) = F(n-1) + F(n-2) + +In list context, F(0) and F(n) is the first and last number in the output, +respectively. For example, if $n is 12, then C<< @F = $n->bfib() >> returns the +following values, F(0) to F(12): + + 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144 + +The sequence can also be extended to negative index n using the re-arranged +recurrence relation + + F(n-2) = F(n) - F(n-1) + +giving the bidirectional sequence + + n -7 -6 -5 -4 -3 -2 -1 0 1 2 3 4 5 6 7 + F(n) 13 -8 5 -3 2 -1 1 0 1 1 2 3 5 8 13 + +If $n is -12, the following values, F(0) to F(12), are returned: + + 0, 1, -1, 2, -3, 5, -8, 13, -21, 34, -55, 89, -144 + +=item blucas() + + $F = $n->blucas(); # a single Lucas number + @F = $n->blucas(); # a list of Lucas numbers + +In scalar context, returns a single Lucas number. In list context, returns a +list of Lucas numbers. The invocand is the last element in the output. + +The Lucas sequence is defined by + + L(0) = 2 + L(1) = 1 + L(n) = L(n-1) + L(n-2) + +In list context, L(0) and L(n) is the first and last number in the output, +respectively. For example, if $n is 12, then C<< @L = $n->blucas() >> returns +the following values, L(0) to L(12): + + 2, 1, 3, 4, 7, 11, 18, 29, 47, 76, 123, 199, 322 + +The sequence can also be extended to negative index n using the re-arranged +recurrence relation + + L(n-2) = L(n) - L(n-1) + +giving the bidirectional sequence + + n -7 -6 -5 -4 -3 -2 -1 0 1 2 3 4 5 6 7 + L(n) 29 -18 11 -7 4 -3 1 2 1 3 4 7 11 18 29 + +If $n is -12, the following values, L(0) to L(-12), are returned: + + 2, 1, -3, 4, -7, 11, -18, 29, -47, 76, -123, 199, -322 + =item brsft() $x->brsft($n); # right shift $n places in base 2 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Math-BigInt-1.999808/t/author-lib-arithmetic-unary-_fib.dat new/Math-BigInt-1.999809/t/author-lib-arithmetic-unary-_fib.dat --- old/Math-BigInt-1.999808/t/author-lib-arithmetic-unary-_fib.dat 1970-01-01 01:00:00.000000000 +0100 +++ new/Math-BigInt-1.999809/t/author-lib-arithmetic-unary-_fib.dat 2017-01-02 16:09:21.000000000 +0100 @@ -0,0 +1,251 @@ +0:0 +1:1 +2:1 +3:2 +4:3 +5:5 +6:8 +7:13 +8:21 +9:34 +10:55 +11:89 +12:144 +13:233 +14:377 +15:610 +16:987 +17:1597 +18:2584 +19:4181 +20:6765 +21:10946 +22:17711 +23:28657 +24:46368 +25:75025 +26:121393 +27:196418 +28:317811 +29:514229 +30:832040 +31:1346269 +32:2178309 +33:3524578 +34:5702887 +35:9227465 +36:14930352 +37:24157817 +38:39088169 +39:63245986 +40:102334155 +41:165580141 +42:267914296 +43:433494437 +44:701408733 +45:1134903170 +46:1836311903 +47:2971215073 +48:4807526976 +49:7778742049 +50:12586269025 +51:20365011074 +52:32951280099 +53:53316291173 +54:86267571272 +55:139583862445 +56:225851433717 +57:365435296162 +58:591286729879 +59:956722026041 +60:1548008755920 +61:2504730781961 +62:4052739537881 +63:6557470319842 +64:10610209857723 +65:17167680177565 +66:27777890035288 +67:44945570212853 +68:72723460248141 +69:117669030460994 +70:190392490709135 +71:308061521170129 +72:498454011879264 +73:806515533049393 +74:1304969544928657 +75:2111485077978050 +76:3416454622906707 +77:5527939700884757 +78:8944394323791464 +79:14472334024676221 +80:23416728348467685 +81:37889062373143906 +82:61305790721611591 +83:99194853094755497 +84:160500643816367088 +85:259695496911122585 +86:420196140727489673 +87:679891637638612258 +88:1100087778366101931 +89:1779979416004714189 +90:2880067194370816120 +91:4660046610375530309 +92:7540113804746346429 +93:12200160415121876738 +94:19740274219868223167 +95:31940434634990099905 +96:51680708854858323072 +97:83621143489848422977 +98:135301852344706746049 +99:218922995834555169026 +100:354224848179261915075 +101:573147844013817084101 +102:927372692193078999176 +103:1500520536206896083277 +104:2427893228399975082453 +105:3928413764606871165730 +106:6356306993006846248183 +107:10284720757613717413913 +108:16641027750620563662096 +109:26925748508234281076009 +110:43566776258854844738105 +111:70492524767089125814114 +112:114059301025943970552219 +113:184551825793033096366333 +114:298611126818977066918552 +115:483162952612010163284885 +116:781774079430987230203437 +117:1264937032042997393488322 +118:2046711111473984623691759 +119:3311648143516982017180081 +120:5358359254990966640871840 +121:8670007398507948658051921 +122:14028366653498915298923761 +123:22698374052006863956975682 +124:36726740705505779255899443 +125:59425114757512643212875125 +126:96151855463018422468774568 +127:155576970220531065681649693 +128:251728825683549488150424261 +129:407305795904080553832073954 +130:659034621587630041982498215 +131:1066340417491710595814572169 +132:1725375039079340637797070384 +133:2791715456571051233611642553 +134:4517090495650391871408712937 +135:7308805952221443105020355490 +136:11825896447871834976429068427 +137:19134702400093278081449423917 +138:30960598847965113057878492344 +139:50095301248058391139327916261 +140:81055900096023504197206408605 +141:131151201344081895336534324866 +142:212207101440105399533740733471 +143:343358302784187294870275058337 +144:555565404224292694404015791808 +145:898923707008479989274290850145 +146:1454489111232772683678306641953 +147:2353412818241252672952597492098 +148:3807901929474025356630904134051 +149:6161314747715278029583501626149 +150:9969216677189303386214405760200 +151:16130531424904581415797907386349 +152:26099748102093884802012313146549 +153:42230279526998466217810220532898 +154:68330027629092351019822533679447 +155:110560307156090817237632754212345 +156:178890334785183168257455287891792 +157:289450641941273985495088042104137 +158:468340976726457153752543329995929 +159:757791618667731139247631372100066 +160:1226132595394188293000174702095995 +161:1983924214061919432247806074196061 +162:3210056809456107725247980776292056 +163:5193981023518027157495786850488117 +164:8404037832974134882743767626780173 +165:13598018856492162040239554477268290 +166:22002056689466296922983322104048463 +167:35600075545958458963222876581316753 +168:57602132235424755886206198685365216 +169:93202207781383214849429075266681969 +170:150804340016807970735635273952047185 +171:244006547798191185585064349218729154 +172:394810887814999156320699623170776339 +173:638817435613190341905763972389505493 +174:1033628323428189498226463595560281832 +175:1672445759041379840132227567949787325 +176:2706074082469569338358691163510069157 +177:4378519841510949178490918731459856482 +178:7084593923980518516849609894969925639 +179:11463113765491467695340528626429782121 +180:18547707689471986212190138521399707760 +181:30010821454963453907530667147829489881 +182:48558529144435440119720805669229197641 +183:78569350599398894027251472817058687522 +184:127127879743834334146972278486287885163 +185:205697230343233228174223751303346572685 +186:332825110087067562321196029789634457848 +187:538522340430300790495419781092981030533 +188:871347450517368352816615810882615488381 +189:1409869790947669143312035591975596518914 +190:2281217241465037496128651402858212007295 +191:3691087032412706639440686994833808526209 +192:5972304273877744135569338397692020533504 +193:9663391306290450775010025392525829059713 +194:15635695580168194910579363790217849593217 +195:25299086886458645685589389182743678652930 +196:40934782466626840596168752972961528246147 +197:66233869353085486281758142155705206899077 +198:107168651819712326877926895128666735145224 +199:173402521172797813159685037284371942044301 +200:280571172992510140037611932413038677189525 +201:453973694165307953197296969697410619233826 +202:734544867157818093234908902110449296423351 +203:1188518561323126046432205871807859915657177 +204:1923063428480944139667114773918309212080528 +205:3111581989804070186099320645726169127737705 +206:5034645418285014325766435419644478339818233 +207:8146227408089084511865756065370647467555938 +208:13180872826374098837632191485015125807374171 +209:21327100234463183349497947550385773274930109 +210:34507973060837282187130139035400899082304280 +211:55835073295300465536628086585786672357234389 +212:90343046356137747723758225621187571439538669 +213:146178119651438213260386312206974243796773058 +214:236521166007575960984144537828161815236311727 +215:382699285659014174244530850035136059033084785 +216:619220451666590135228675387863297874269396512 +217:1001919737325604309473206237898433933302481297 +218:1621140188992194444701881625761731807571877809 +219:2623059926317798754175087863660165740874359106 +220:4244200115309993198876969489421897548446236915 +221:6867260041627791953052057353082063289320596021 +222:11111460156937785151929026842503960837766832936 +223:17978720198565577104981084195586024127087428957 +224:29090180355503362256910111038089984964854261893 +225:47068900554068939361891195233676009091941690850 +226:76159080909572301618801306271765994056795952743 +227:123227981463641240980692501505442003148737643593 +228:199387062373213542599493807777207997205533596336 +229:322615043836854783580186309282650000354271239929 +230:522002106210068326179680117059857997559804836265 +231:844617150046923109759866426342507997914076076194 +232:1366619256256991435939546543402365995473880912459 +233:2211236406303914545699412969744873993387956988653 +234:3577855662560905981638959513147239988861837901112 +235:5789092068864820527338372482892113982249794889765 +236:9366947731425726508977331996039353971111632790877 +237:15156039800290547036315704478931467953361427680642 +238:24522987531716273545293036474970821924473060471519 +239:39679027332006820581608740953902289877834488152161 +240:64202014863723094126901777428873111802307548623680 +241:103881042195729914708510518382775401680142036775841 +242:168083057059453008835412295811648513482449585399521 +243:271964099255182923543922814194423915162591622175362 +244:440047156314635932379335110006072428645041207574883 +245:712011255569818855923257924200496343807632829750245 +246:1152058411884454788302593034206568772452674037325128 +247:1864069667454273644225850958407065116260306867075373 +248:3016128079338728432528443992613633888712980904400501 +249:4880197746793002076754294951020699004973287771475874 +250:7896325826131730509282738943634332893686268675876375 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Math-BigInt-1.999808/t/author-lib-arithmetic-unary-_fib.t new/Math-BigInt-1.999809/t/author-lib-arithmetic-unary-_fib.t --- old/Math-BigInt-1.999808/t/author-lib-arithmetic-unary-_fib.t 1970-01-01 01:00:00.000000000 +0100 +++ new/Math-BigInt-1.999809/t/author-lib-arithmetic-unary-_fib.t 2017-01-30 16:11:09.000000000 +0100 @@ -0,0 +1,140 @@ +#!perl + +BEGIN { + unless ($ENV{AUTHOR_TESTING}) { + require Test::More; + Test::More::plan(skip_all => + 'these tests are for testing by the author'); + } +} + +use strict; +use warnings; + +use Test::More tests => 1005; + +############################################################################### +# Read and load configuration file and backend library. + +use Config::Tiny (); + +my $config_file = 't/author-lib.ini'; +my $config = Config::Tiny -> read('t/author-lib.ini') + or die Config::Tiny -> errstr(); + +# Read the library to test. + +our $LIB = $config->{_}->{lib}; + +die "No library defined in file '$config_file'" + unless defined $LIB; +die "Invalid library name '$LIB' in file '$config_file'" + unless $LIB =~ /^[A-Za-z]\w*(::\w+)*\z/; + +# Read the reference type(s) the library uses. + +our $REF = $config->{_}->{ref}; + +die "No reference type defined in file '$config_file'" + unless defined $REF; +die "Invalid reference type '$REF' in file '$config_file'" + unless $REF =~ /^[A-Za-z]\w*(::\w+)*\z/; + +# Load the library. + +eval "require $LIB"; +die $@ if $@; + +############################################################################### + +can_ok($LIB, '_fib'); + +my @data; + +# Add data in data file. + +(my $datafile = $0) =~ s/\.t/.dat/; +open DATAFILE, $datafile or die "$datafile: can't open file for reading: $!"; +while (<DATAFILE>) { + s/\s+\z//; + next if /^#/ || ! /\S/; + push @data, [ split /:/ ]; +} +close DATAFILE or die "$datafile: can't close file after reading: $!"; + +# List context. + +for (my $i = 0 ; $i <= $#data ; ++ $i) { + my $in0 = $i; + my $out = [ map { $data[$_][1] } 0 .. $i ]; + + my ($x, @got); + + my $test = qq|\$x = $LIB->_new("$in0"); | + . qq|\@got = $LIB->_fib(\$x);|; + + diag("\n$test\n\n") if $ENV{AUTHOR_DEBUGGING}; + + eval $test; + is($@, "", "'$test' gives emtpy \$\@"); + + subtest "_fib() in list context: $test", sub { + plan tests => 3 * $i + 6, + + cmp_ok(scalar @got, "==", scalar @$out, + "'$test' gives one output arg"); + + for (my $j = 0 ; $j <= $#$out ; ++ $j) { + + is(ref($got[$j]), $REF, + "'$test' output arg is a $REF"); + + is($LIB->_check($got[$j]), 0, + "'$test' output is valid"); + + is($LIB->_str($got[$j]), $out->[$j], + "'$test' output arg has the right value"); + } + + is(ref($x), $REF, + "'$test' input arg is still a $REF"); + + ok($LIB->_str($x) eq $out->[-1] || $LIB->_str($x) eq $in0, + "'$test' input arg has the correct value"); + }; +} + +# Scalar context. + +for (my $i = 0 ; $i <= $#data ; ++ $i) { + my ($in0, $out0) = @{ $data[$i] }; + + my ($x, $got); + + my $test = qq|\$x = $LIB->_new("$in0"); | + . qq|\$got = $LIB->_fib(\$x);|; + + diag("\n$test\n\n") if $ENV{AUTHOR_DEBUGGING}; + + eval $test; + is($@, "", "'$test' gives emtpy \$\@"); + + subtest "_fib() in scalar context: $test", sub { + plan tests => 5, + + is(ref($got), $REF, + "'$test' output arg is a $REF"); + + is($LIB->_check($got), 0, + "'$test' output is valid"); + + is($LIB->_str($got), $out0, + "'$test' output arg has the right value"); + + is(ref($x), $REF, + "'$test' input arg is still a $REF"); + + ok($LIB->_str($x) eq $out0 || $LIB->_str($x) eq $in0, + "'$test' input arg has the correct value"); + }; +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Math-BigInt-1.999808/t/author-lib-arithmetic-unary-_lucas.dat new/Math-BigInt-1.999809/t/author-lib-arithmetic-unary-_lucas.dat --- old/Math-BigInt-1.999808/t/author-lib-arithmetic-unary-_lucas.dat 1970-01-01 01:00:00.000000000 +0100 +++ new/Math-BigInt-1.999809/t/author-lib-arithmetic-unary-_lucas.dat 2017-01-02 19:28:30.000000000 +0100 @@ -0,0 +1,251 @@ +0:2 +1:1 +2:3 +3:4 +4:7 +5:11 +6:18 +7:29 +8:47 +9:76 +10:123 +11:199 +12:322 +13:521 +14:843 +15:1364 +16:2207 +17:3571 +18:5778 +19:9349 +20:15127 +21:24476 +22:39603 +23:64079 +24:103682 +25:167761 +26:271443 +27:439204 +28:710647 +29:1149851 +30:1860498 +31:3010349 +32:4870847 +33:7881196 +34:12752043 +35:20633239 +36:33385282 +37:54018521 +38:87403803 +39:141422324 +40:228826127 +41:370248451 +42:599074578 +43:969323029 +44:1568397607 +45:2537720636 +46:4106118243 +47:6643838879 +48:10749957122 +49:17393796001 +50:28143753123 +51:45537549124 +52:73681302247 +53:119218851371 +54:192900153618 +55:312119004989 +56:505019158607 +57:817138163596 +58:1322157322203 +59:2139295485799 +60:3461452808002 +61:5600748293801 +62:9062201101803 +63:14662949395604 +64:23725150497407 +65:38388099893011 +66:62113250390418 +67:100501350283429 +68:162614600673847 +69:263115950957276 +70:425730551631123 +71:688846502588399 +72:1114577054219522 +73:1803423556807921 +74:2918000611027443 +75:4721424167835364 +76:7639424778862807 +77:12360848946698171 +78:20000273725560978 +79:32361122672259149 +80:52361396397820127 +81:84722519070079276 +82:137083915467899403 +83:221806434537978679 +84:358890350005878082 +85:580696784543856761 +86:939587134549734843 +87:1520283919093591604 +88:2459871053643326447 +89:3980154972736918051 +90:6440026026380244498 +91:10420180999117162549 +92:16860207025497407047 +93:27280388024614569596 +94:44140595050111976643 +95:71420983074726546239 +96:115561578124838522882 +97:186982561199565069121 +98:302544139324403592003 +99:489526700523968661124 +100:792070839848372253127 +101:1281597540372340914251 +102:2073668380220713167378 +103:3355265920593054081629 +104:5428934300813767249007 +105:8784200221406821330636 +106:14213134522220588579643 +107:22997334743627409910279 +108:37210469265847998489922 +109:60207804009475408400201 +110:97418273275323406890123 +111:157626077284798815290324 +112:255044350560122222180447 +113:412670427844921037470771 +114:667714778405043259651218 +115:1080385206249964297121989 +116:1748099984655007556773207 +117:2828485190904971853895196 +118:4576585175559979410668403 +119:7405070366464951264563599 +120:11981655542024930675232002 +121:19386725908489881939795601 +122:31368381450514812615027603 +123:50755107359004694554823204 +124:82123488809519507169850807 +125:132878596168524201724674011 +126:215002084978043708894524818 +127:347880681146567910619198829 +128:562882766124611619513723647 +129:910763447271179530132922476 +130:1473646213395791149646646123 +131:2384409660666970679779568599 +132:3858055874062761829426214722 +133:6242465534729732509205783321 +134:10100521408792494338631998043 +135:16342986943522226847837781364 +136:26443508352314721186469779407 +137:42786495295836948034307560771 +138:69230003648151669220777340178 +139:112016498943988617255084900949 +140:181246502592140286475862241127 +141:293263001536128903730947142076 +142:474509504128269190206809383203 +143:767772505664398093937756525279 +144:1242282009792667284144565908482 +145:2010054515457065378082322433761 +146:3252336525249732662226888342243 +147:5262391040706798040309210776004 +148:8514727565956530702536099118247 +149:13777118606663328742845309894251 +150:22291846172619859445381409012498 +151:36068964779283188188226718906749 +152:58360810951903047633608127919247 +153:94429775731186235821834846825996 +154:152790586683089283455442974745243 +155:247220362414275519277277821571239 +156:400010949097364802732720796316482 +157:647231311511640322009998617887721 +158:1047242260609005124742719414204203 +159:1694473572120645446752718032091924 +160:2741715832729650571495437446296127 +161:4436189404850296018248155478388051 +162:7177905237579946589743592924684178 +163:11614094642430242607991748403072229 +164:18791999880010189197735341327756407 +165:30406094522440431805727089730828636 +166:49198094402450621003462431058585043 +167:79604188924891052809189520789413679 +168:128802283327341673812651951847998722 +169:208406472252232726621841472637412401 +170:337208755579574400434493424485411123 +171:545615227831807127056334897122823524 +172:882823983411381527490828321608234647 +173:1428439211243188654547163218731058171 +174:2311263194654570182037991540339292818 +175:3739702405897758836585154759070350989 +176:6050965600552329018623146299409643807 +177:9790668006450087855208301058479994796 +178:15841633607002416873831447357889638603 +179:25632301613452504729039748416369633399 +180:41473935220454921602871195774259272002 +181:67106236833907426331910944190628905401 +182:108580172054362347934782139964888177403 +183:175686408888269774266693084155517082804 +184:284266580942632122201475224120405260207 +185:459952989830901896468168308275922343011 +186:744219570773534018669643532396327603218 +187:1204172560604435915137811840672249946229 +188:1948392131377969933807455373068577549447 +189:3152564691982405848945267213740827495676 +190:5100956823360375782752722586809405045123 +191:8253521515342781631697989800550232540799 +192:13354478338703157414450712387359637585922 +193:21607999854045939046148702187909870126721 +194:34962478192749096460599414575269507712643 +195:56570478046795035506748116763179377839364 +196:91532956239544131967347531338448885552007 +197:148103434286339167474095648101628263391371 +198:239636390525883299441443179440077148943378 +199:387739824812222466915538827541705412334749 +200:627376215338105766356982006981782561278127 +201:1015116040150328233272520834523487973612876 +202:1642492255488433999629502841505270534891003 +203:2657608295638762232902023676028758508503879 +204:4300100551127196232531526517534029043394882 +205:6957708846765958465433550193562787551898761 +206:11257809397893154697965076711096816595293643 +207:18215518244659113163398626904659604147192404 +208:29473327642552267861363703615756420742486047 +209:47688845887211381024762330520416024889678451 +210:77162173529763648886126034136172445632164498 +211:124851019416975029910888364656588470521842949 +212:202013192946738678797014398792760916154007447 +213:326864212363713708707902763449349386675850396 +214:528877405310452387504917162242110302829857843 +215:855741617674166096212819925691459689505708239 +216:1384619022984618483717737087933569992335566082 +217:2240360640658784579930557013625029681841274321 +218:3624979663643403063648294101558599674176840403 +219:5865340304302187643578851115183629356018114724 +220:9490319967945590707227145216742229030194955127 +221:15355660272247778350805996331925858386213069851 +222:24845980240193369058033141548668087416408024978 +223:40201640512441147408839137880593945802621094829 +224:65047620752634516466872279429262033219029119807 +225:105249261265075663875711417309855979021650214636 +226:170296882017710180342583696739118012240679334443 +227:275546143282785844218295114048973991262329549079 +228:445843025300496024560878810788092003503008883522 +229:721389168583281868779173924837065994765338432601 +230:1167232193883777893340052735625157998268347316123 +231:1888621362467059762119226660462223993033685748724 +232:3055853556350837655459279396087381991302033064847 +233:4944474918817897417578506056549605984335718813571 +234:8000328475168735073037785452636987975637751878418 +235:12944803393986632490616291509186593959973470691989 +236:20945131869155367563654076961823581935611222570407 +237:33889935263142000054270368471010175895584693262396 +238:54835067132297367617924445432833757831195915832803 +239:88725002395439367672194813903843933726780609095199 +240:143560069527736735290119259336677691557976524928002 +241:232285071923176102962314073240521625284757134023201 +242:375845141450912838252433332577199316842733658951203 +243:608130213374088941214747405817720942127490792974404 +244:983975354825001779467180738394920258970224451925607 +245:1592105568199090720681928144212641201097715244900011 +246:2576080923024092500149108882607561460067939696825618 +247:4168186491223183220831037026820202661165654941725629 +248:6744267414247275720980145909427764121233594638551247 +249:10912453905470458941811182936247966782399249580276876 +250:17656721319717734662791328845675730903632844218828123 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Math-BigInt-1.999808/t/author-lib-arithmetic-unary-_lucas.t new/Math-BigInt-1.999809/t/author-lib-arithmetic-unary-_lucas.t --- old/Math-BigInt-1.999808/t/author-lib-arithmetic-unary-_lucas.t 1970-01-01 01:00:00.000000000 +0100 +++ new/Math-BigInt-1.999809/t/author-lib-arithmetic-unary-_lucas.t 2017-01-31 13:17:55.000000000 +0100 @@ -0,0 +1,140 @@ +#!perl + +BEGIN { + unless ($ENV{AUTHOR_TESTING}) { + require Test::More; + Test::More::plan(skip_all => + 'these tests are for testing by the author'); + } +} + +use strict; +use warnings; + +use Test::More tests => 1005; + +############################################################################### +# Read and load configuration file and backend library. + +use Config::Tiny (); + +my $config_file = 't/author-lib.ini'; +my $config = Config::Tiny -> read('t/author-lib.ini') + or die Config::Tiny -> errstr(); + +# Read the library to test. + +our $LIB = $config->{_}->{lib}; + +die "No library defined in file '$config_file'" + unless defined $LIB; +die "Invalid library name '$LIB' in file '$config_file'" + unless $LIB =~ /^[A-Za-z]\w*(::\w+)*\z/; + +# Read the reference type(s) the library uses. + +our $REF = $config->{_}->{ref}; + +die "No reference type defined in file '$config_file'" + unless defined $REF; +die "Invalid reference type '$REF' in file '$config_file'" + unless $REF =~ /^[A-Za-z]\w*(::\w+)*\z/; + +# Load the library. + +eval "require $LIB"; +die $@ if $@; + +############################################################################### + +can_ok($LIB, '_lucas'); + +my @data; + +# Add data in data file. + +(my $datafile = $0) =~ s/\.t/.dat/; +open DATAFILE, $datafile or die "$datafile: can't open file for reading: $!"; +while (<DATAFILE>) { + s/\s+\z//; + next if /^#/ || ! /\S/; + push @data, [ split /:/ ]; +} +close DATAFILE or die "$datafile: can't close file after reading: $!"; + +# List context. + +for (my $i = 0 ; $i <= $#data ; ++ $i) { + my $in0 = $i; + my $out = [ map { $data[$_][1] } 0 .. $i ]; + + my ($x, @got); + + my $test = qq|\$x = $LIB->_new("$in0"); | + . qq|\@got = $LIB->_lucas(\$x);|; + + diag("\n$test\n\n") if $ENV{AUTHOR_DEBUGGING}; + + eval $test; + is($@, "", "'$test' gives emtpy \$\@"); + + subtest "_lucas() in list context: $test", sub { + plan tests => 3 * $i + 6, + + cmp_ok(scalar @got, "==", scalar @$out, + "'$test' gives one output arg"); + + for (my $j = 0 ; $j <= $#$out ; ++ $j) { + + is(ref($got[$j]), $REF, + "'$test' output arg is a $REF"); + + is($LIB->_check($got[$j]), 0, + "'$test' output is valid"); + + is($LIB->_str($got[$j]), $out->[$j], + "'$test' output arg has the right value"); + } + + is(ref($x), $REF, + "'$test' input arg is still a $REF"); + + ok($LIB->_str($x) eq $out->[-1] || $LIB->_str($x) eq $in0, + "'$test' input arg has the correct value"); + }; +} + +# Scalar context. + +for (my $i = 0 ; $i <= $#data ; ++ $i) { + my ($in0, $out0) = @{ $data[$i] }; + + my ($x, $got); + + my $test = qq|\$x = $LIB->_new("$in0"); | + . qq|\$got = $LIB->_lucas(\$x);|; + + diag("\n$test\n\n") if $ENV{AUTHOR_DEBUGGING}; + + eval $test; + is($@, "", "'$test' gives emtpy \$\@"); + + subtest "_lucas() in scalar context: $test", sub { + plan tests => 5, + + is(ref($got), $REF, + "'$test' output arg is a $REF"); + + is($LIB->_check($got), 0, + "'$test' output is valid"); + + is($LIB->_str($got), $out0, + "'$test' output arg has the right value"); + + is(ref($x), $REF, + "'$test' input arg is still a $REF"); + + ok($LIB->_str($x) eq $out0 || $LIB->_str($x) eq $in0, + "'$test' input arg has the correct value"); + }; +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Math-BigInt-1.999808/t/bfib-mbi.t new/Math-BigInt-1.999809/t/bfib-mbi.t --- old/Math-BigInt-1.999808/t/bfib-mbi.t 1970-01-01 01:00:00.000000000 +0100 +++ new/Math-BigInt-1.999809/t/bfib-mbi.t 2017-02-06 16:04:07.000000000 +0100 @@ -0,0 +1,86 @@ +#!perl + +use strict; +use warnings; + +use Test::More tests => 15; + +use Math::BigInt; + +my $x; + +############################################################################### +# Scalar context. +############################################################################### + +my $y; + +# Finite numbers. + +$x = Math::BigInt -> new("-20"); +$y = $x -> bfib(); +is($y, "-6765", "bfib(-20)"); + +$x = Math::BigInt -> new("-15"); +$y = $x -> bfib(); +is($y, "610", "bfib(-15)"); + +$x = Math::BigInt -> new("-2"); +$y = $x -> bfib(); +is($y, "-1", "bfib(-2)"); + +$x = Math::BigInt -> new("-1"); +$y = $x -> bfib(); +is($y, "1", "bfib(-1)"); + +$x = Math::BigInt -> new("0"); +$y = $x -> bfib(); +is($y, "0", "bfib(0)"); + +$x = Math::BigInt -> new("1"); +$y = $x -> bfib(); +is($y, "1", "bfib(1)"); + +$x = Math::BigInt -> new("2"); +$y = $x -> bfib(); +is($y, "1", "bfib(2)"); + +$x = Math::BigInt -> new("15"); +$y = $x -> bfib(); +is($y, "610", "bfib(15)"); + +$x = Math::BigInt -> new("20"); +$y = $x -> bfib(); +is($y, "6765", "bfib(20)"); + +$x = Math::BigInt -> new("250"); +$y = $x -> bfib(); +is($y, "7896325826131730509282738943634332893686268675876375", "bfib(250)"); + +# Infinites and NaN. + +$x = Math::BigInt -> binf("+"); +$y = $x -> bfib(); +is($y, "inf", "bfib(+inf)"); + +$x = Math::BigInt -> binf("-"); +$y = $x -> bfib(); +is($y, "NaN", "bfib(-inf)"); + +$x = Math::BigInt -> bnan(); +$y = $x -> bfib(); +is($y, "NaN", "bfib(NaN)"); + +############################################################################### +# List context. +############################################################################### + +my @y; + +$x = Math::BigInt -> new("10"); +@y = $x -> bfib(); +is_deeply(\@y, [0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55], "bfib(10)"); + +$x = Math::BigInt -> new("-10"); +@y = $x -> bfib(); +is_deeply(\@y, [0, 1, -1, 2, -3, 5, -8, 13, -21, 34, -55], "bfib(-10)"); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Math-BigInt-1.999808/t/blucas-mbi.t new/Math-BigInt-1.999809/t/blucas-mbi.t --- old/Math-BigInt-1.999808/t/blucas-mbi.t 1970-01-01 01:00:00.000000000 +0100 +++ new/Math-BigInt-1.999809/t/blucas-mbi.t 2017-02-06 16:09:35.000000000 +0100 @@ -0,0 +1,86 @@ +#!perl + +use strict; +use warnings; + +use Test::More tests => 15; + +use Math::BigInt; + +my $x; + +############################################################################### +# Scalar context. +############################################################################### + +my $y; + +# Finite numbers. + +$x = Math::BigInt -> new("-20"); +$y = $x -> blucas(); +is($y, "-15127", "blucas(-20)"); + +$x = Math::BigInt -> new("-15"); +$y = $x -> blucas(); +is($y, "1364", "blucas(-15)"); + +$x = Math::BigInt -> new("-2"); +$y = $x -> blucas(); +is($y, "-3", "blucas(-2)"); + +$x = Math::BigInt -> new("-1"); +$y = $x -> blucas(); +is($y, "1", "blucas(-1)"); + +$x = Math::BigInt -> new("0"); +$y = $x -> blucas(); +is($y, "2", "blucas(0)"); + +$x = Math::BigInt -> new("1"); +$y = $x -> blucas(); +is($y, "1", "blucas(1)"); + +$x = Math::BigInt -> new("2"); +$y = $x -> blucas(); +is($y, "3", "blucas(2)"); + +$x = Math::BigInt -> new("15"); +$y = $x -> blucas(); +is($y, "1364", "blucas(15)"); + +$x = Math::BigInt -> new("20"); +$y = $x -> blucas(); +is($y, "15127", "blucas(20)"); + +$x = Math::BigInt -> new("250"); +$y = $x -> blucas(); +is($y, "17656721319717734662791328845675730903632844218828123", "blucas(250)"); + +# Infinites and NaN. + +$x = Math::BigInt -> binf("+"); +$y = $x -> blucas(); +is($y, "inf", "blucas(+inf)"); + +$x = Math::BigInt -> binf("-"); +$y = $x -> blucas(); +is($y, "NaN", "blucas(-inf)"); + +$x = Math::BigInt -> bnan(); +$y = $x -> blucas(); +is($y, "NaN", "blucas(NaN)"); + +############################################################################### +# List context. +############################################################################### + +my @y; + +$x = Math::BigInt -> new("10"); +@y = $x -> blucas(); +is_deeply(\@y, [2, 1, 3, 4, 7, 11, 18, 29, 47, 76, 123], "blucas(10)"); + +$x = Math::BigInt -> new("-10"); +@y = $x -> blucas(); +is_deeply(\@y, [2, 1, -3, 4, -7, 11, -18, 29, -47, 76, -123], "blucas(-10)"); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Math-BigInt-1.999808/t/calling.t new/Math-BigInt-1.999809/t/calling.t --- old/Math-BigInt-1.999808/t/calling.t 2017-01-05 19:47:16.000000000 +0100 +++ new/Math-BigInt-1.999809/t/calling.t 2017-02-06 16:38:08.000000000 +0100 @@ -6,7 +6,7 @@ use warnings; use lib 't'; -my $VERSION = '1.999808'; # adjust manually to match latest release +my $VERSION = '1.999809'; # adjust manually to match latest release use Test::More tests => 5;