Commit 6d120cdf authored by Jonathan Yu's avatar Jonathan Yu

[svn-upgrade] new version libmath-bigint-perl (1.993)

parent c28ec89b
......@@ -213,31 +213,31 @@ Math::BigFloat:
2001-03-06 1.03: layed more foundations (mul() etc)
2001-03-27 1.04: bmul/bdiv/cmp work now, better _norm()
2001-03-31 1.05: fixed bstr() and bsstr()
added AUTOLOAD for fxxx() to work as well as bxxx()
enhanced and fixed testsuite for mul/cmp/add/new
added AUTOLOAD for fxxx() to work as well as bxxx()
enhanced and fixed testsuite for mul/cmp/add/new
2001-04-05 1.06: bstr() returns NaN for NaN's
renamed _norm to bnorm, added it to AUTOLOAD for compatibility
fixed bug Math::BigFloat->new(Math::BigInt->new(3));
bug mul/div when second arg was BigInt
bdiv() works now with precision
precision()
doc about mixing different objects in overloaded math
renamed _norm to bnorm, added it to AUTOLOAD for compatibility
fixed bug Math::BigFloat->new(Math::BigInt->new(3));
bug mul/div when second arg was BigInt
bdiv() works now with precision
precision()
doc about mixing different objects in overloaded math
2001-04-07 1.07: bug in bstr() for 0.xxx style numbers, as well as for "-xxx"
babs(), bneg(), bint() work now
empty stubs for bsqrt(), bround() and bmod()
exponent(), mantissa(), parts() work now as expected
babs(), bneg(), bint() work now
empty stubs for bsqrt(), bround() and bmod()
exponent(), mantissa(), parts() work now as expected
2001-04-18 1.08: exponent(), mantissa() and parts() now return BigInt's
bnorm: 0Ey => 0E1 (was wrongly 0E0)
fixed is_zero()
added bround() and bfround() (only truncate mode)
bnorm: 0Ey => 0E1 (was wrongly 0E0)
fixed is_zero()
added bround() and bfround() (only truncate mode)
fixed bug in bstr() for 1.203E-2 style numbers (Thanx Tom!)
2001-04-23 1.09: length() in list context return length of mantissa & exponent
bug in bstr() for '0.x' style strings
added bsqrt()
workaround for Perl v5.6.0 overload-bool bug (via MBI)
bug in bstr() for '0.x' style strings
added bsqrt()
workaround for Perl v5.6.0 overload-bool bug (via MBI)
fixed rounding
2001-05-07 1.10: Tom's round fixes (minus one nit)
new: .xxx, -.xxx, +.xxx etc are valid inputs, while
new: .xxx, -.xxx, +.xxx etc are valid inputs, while
'.', 'x x x' and 'Exxx' are now invalid
finally got rid of C&P of overload section and clone()
2001-05-09 1.11: bug bcmp() (1e-08 was < 0, aka fractions were broken)
......@@ -991,8 +991,60 @@ Math::BigInt:
(Closes RT#62643).
* Make digit($n) return 0 for "out of range"-digits (Peter John Acklam)
(Closes RT#61812).
2010-11-15 v1.99 rafl
* Stop as_int/as_number from losing precision (Peter John Acklam)
(Closes: RT#43694)
* Fix Math::BigInt::Calc::_modpow for (0 ** $x) % $y, with $x > 0
(Peter John Acklam) (Closes: RT#62918).
* Stop $x -> bmodpow(1, 1) from failing when $x is large (Peter John Acklam)
(Closes: RT#62949).
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
(Peter John Acklam) (Closes: RT #25274).
* Fix Math::BigFloat->bcmp() so it can handle arbitrarily large exponents
(Peter John Acklam) (Closes: RT #62764).
* Fix bmodpow() in Math::BigInt 1.99 mis-calculating powers of one
(Peter John Acklam) (Closes: RT #63237).
* Fix bmodpow() and bmodinv() in Math::BigInt to handle negative input
(Peter John Acklam) (Closes: RT #61543)
* Clean up whitespace (Nicholas Clark).
* Added file t/00-signature.t for testing SIGNATURE (Peter John Acklam).
2011-02-05 v1.991 pjacklam
* Add workaround for library inconsistencies (Math::BigInt::Calc vs.
Math::BigInt::GMP). This makes older versions of Math::BigInt::GMP
work with latest version of Math::BigInt (Peter John Acklam).
* Correct and extend API documentation (Peter John Acklam).
2011-02-18 v1.992 pjacklam
* Math::BigInt::Calc->_nok(): Use symmetry property nok(n,k) = nok(n,n-k) to
speed up execution when k is large. Also general code cleanup. (Peter John
Acklam).
* Math::BigInt::Calc->_gcd(): Speed up by reducing amount of data copying
(Peter John Acklam).
* Add '01load.t' for basic module loading and diagnostics useful for
debugging. Rename '00-signature.t' to '00sig.t', 'pod.t' to '02pod.t', and
'pod_cov.t' to '03podcov.t' (Peter John Acklam).
* Math::BigInt:: Make from_hex(), from_oct(), and behave more like hex() and
oct() in the Perl core, and make from_bin() consistent with from_hex() and
from_oct() (this is related to RT #58954) (Peter John Acklam).
* Math::BigInt::Calc->_rem(): Modify first input arg always, not just
sometimes (Peter John Acklam).
* Math::BigInt::Calc->_modinv(): be more consistent with the _modinv() method
in other libraries (Math::BigInt::GMP, etc.) (Peter John Acklam)
* Math::BigInt::Calc->_nok(): use symmetry property nok(n,k) = nok(n,n-k).
This cuts computation time tremendously when n and k are large (Peter John
Acklam).
* Math::BigInt::Calc->_gcd(): quickly handle zero cases, avoid code
duplication, and always modify the first input argument in-place (Peter John
Acklam).
* Clean up code and add more code comments (Peter John Acklam).
* Fix typos (Peter John Acklam).
2011-02-26 v1.993 pjacklam
* Change default backend library from Math::BigInt::FastCalc to
Math::BigInt::Calc, which is included in the Math-BigInt distro. This
avoids recursive distribution dependency (RT #65976) (Peter John Acklam).
Please send me test-reports, your experiences with this and your ideas - I love
to hear about my work!
Please send us test-reports, your experiences with this and your ideas - we love
to hear about our work!
Tels <http://bloodgate.com/>
The Math-BigInt developers <bignum@lists.scsys.co.uk>
......@@ -28,6 +28,10 @@ MANIFEST.SKIP
META.yml
NEW
README
t/00sig.t
t/01load.t
t/02pod.t
t/03podcov.t
t/_e_math.t
t/alias.inc
t/bare_mbf.t
......@@ -61,8 +65,6 @@ t/mbimbf.inc
t/mbimbf.t
t/nan_cmp.t
t/new_overloaded.t
t/pod.t
t/pod_cov.t
t/req_mbf0.t
t/req_mbf1.t
t/req_mbfa.t
......
......@@ -4,6 +4,8 @@
^Makefile\z
^Makefile.(old|bak)\z
^MANIFEST.(old|bak)\z
^Math-BigInt-.*
^MYMETA\.yml\z
pm_to_blib
\.git*
\.git
.*\.patch\z
^Math-BigInt-
......@@ -21,13 +21,13 @@ no_index:
- inc
- t
recommends:
Math::BigInt::FastCalc: 0.24
Math::BigInt::GMP: 1.24
Math::BigInt::Pari: 1.13
Math::BigRat: 0.22
Math::BigInt::FastCalc: 0.25
Math::BigInt::GMP: 1.35
Math::BigInt::Pari: 1.15
Math::BigRat: 0.2602
bignum: 0.22
requires:
perl: 5.006002
resources:
license: http://dev.perl.org/licenses/
version: 1.98
version: 1.992
......@@ -7,26 +7,32 @@ use strict;
use inc::Module::Install;
# The name of your distribution
name 'Math-BigInt';
name 'Math-BigInt';
# Get most of the details from the primary module
all_from 'lib/Math/BigInt.pm';
all_from 'lib/Math/BigInt.pm';
requires 'perl' => 5.006002;
# As long as Math::BigInt defaults to using Math::BigInt::FastCalc as its
# library (back-end), we require it (see RT #49569).
requires 'perl' => 5.006002;
# See if old versions are installed, and if so, tell the user that
# upgrading them would make little fluffy kittens much happier:
my @checks;
check_minimum_version ('Math::BigInt::FastCalc' => 0.24);
check_minimum_version ('Math::BigInt::GMP' => 1.24);
check_minimum_version ('Math::BigInt::Pari' => 1.13);
check_minimum_version ('Math::BigRat' => 0.22);
check_minimum_version ('bignum' => 0.22);
check_minimum_version ('Math::BigInt::FastCalc' => 0.25);
check_minimum_version ('Math::BigInt::GMP' => 1.35);
check_minimum_version ('Math::BigInt::Pari' => 1.15);
check_minimum_version ('Math::BigRat' => 0.2602);
check_minimum_version ('bignum' => 0.22);
if (@checks > 0)
{
print ("\n" . '*' x 70 . "\n Attention: After installing this package, you should also update:\n\n");
print <<"EOF";
**********************************************************************
Attention: After installing this package, you should also update:
EOF
for my $n (@checks)
{
my $name = $n->[0]; while (length($name) < 24) { $name .= ' '; }
......@@ -36,16 +42,16 @@ if (@checks > 0)
sleep(5);
};
build_requires 'Test::More' => 0.62;
build_requires 'Test::More' => 0.62;
install_as_core();
license 'perl';
license 'perl';
author 'Tels <nospam-abuse@bloodgate.com>';
author 'Tels <nospam-abuse@bloodgate.com>';
# Do not index these
no_index directory => 'examples';
no_index directory => 'examples';
sign;
......@@ -60,7 +66,7 @@ sub check_minimum_version
my $v; eval " require $module; \$v = \$${module}::VERSION;";
recommends $module, $version;
recommends $module, $version;
# if the module is installed, but outdated, add it to the requirements
if (defined $v && $v < $version)
......
......@@ -16,16 +16,16 @@ Hash: SHA1
SHA1 f6ef98e8f3f6a4f670d569f279ef5a3c05c16d0c BENCHMARK
SHA1 89a3a97b2a4c5bb8919e51856a35b493cd5f9312 BUGS
SHA1 4b60ae58a8988bd06c38a36af87ab4aae5d9edee CHANGES
SHA1 2414bb0802239c24f6a2ed9787c596921c638642 CHANGES
SHA1 f27c8bd98e754f96c9825fa6ce9f1244c93bdbe6 CREDITS
SHA1 bc2db74538d3acd53f71b5512a144fe18c253ecd GOALS
SHA1 fe61299e80a1dca48fbaa33f0869e3238ec07c70 HISTORY
SHA1 c42565ad26cdf91502bacf19a4f7080e63c51fe2 INSTALL
SHA1 d6a6c30ee6d9ba6b9afab8bbf6a25e1b23c744e0 LICENSE
SHA1 edf65da7a9aa11174d4367c1db4e11d225e134b0 MANIFEST
SHA1 28e0843acbc175242b0744c7a2a5b2e9397489ee MANIFEST.SKIP
SHA1 fbbe0ba6331e008cc7dd321a670fbc3450b01ecc META.yml
SHA1 deef6557db1863323fe676630c906dc071afd0fc Makefile.PL
SHA1 a33c4dc2215b88e7056fe88ca0f2eaa71652ff40 MANIFEST
SHA1 fa2271022ccdfc09bd60e4bfa2683f0487096f02 MANIFEST.SKIP
SHA1 6de3ba298893c49d05fd1f434d8cbad0b6543704 META.yml
SHA1 23376979b4ae0e8d9a36d2d337799e245f73d1f5 Makefile.PL
SHA1 2ec9bfda86bb2073e9423e6a86bb6956c06ebb2f NEW
SHA1 481f5827752d2100914db1eaeb60bf0bbd13529e README
SHA1 f1500916b488220b707bc10a0388d7dbcfd52e99 TODO
......@@ -41,29 +41,33 @@ SHA1 b721c93ca5bc9a6aa863b49af15f1b1de6125935 inc/Module/Install/Makefile.pm
SHA1 026cc0551a0ad399d195e395b46bdf842e115192 inc/Module/Install/Metadata.pm
SHA1 5457015ea5a50e93465bf2dafa29feebd547f85b inc/Module/Install/Win32.pm
SHA1 051e7fa8063908befa3440508d0584a2497b97db inc/Module/Install/WriteAll.pm
SHA1 59d86282d805f69f7bd2d147c36a853a9064bf29 lib/Math/BigFloat.pm
SHA1 9200a491c734c1061b3e33d7d39559dba95c6c87 lib/Math/BigInt.pm
SHA1 8a715d64481cbb479ebb173828090a684d99906c lib/Math/BigInt/Calc.pm
SHA1 598452b37dbd4bbd2fb4c9cc559e0e0ac91f9bd8 lib/Math/BigInt/CalcEmu.pm
SHA1 0e857a88d53686b11ce147b61802a6a2d36340ca lib/Math/BigFloat.pm
SHA1 cd04861879676149ccbf7a27f0149cf4f62101ab lib/Math/BigInt.pm
SHA1 c1153cbf42c279a41fba2b5e5c2bdf3a8850e735 lib/Math/BigInt/Calc.pm
SHA1 29813d9612be8ec0ac65dd7eeec5b6f756320229 lib/Math/BigInt/CalcEmu.pm
SHA1 a2d393f9d265801f8ef022725d03f83b616b2fe1 t/00sig.t
SHA1 32b73052135171974d5c522f0dee665a03dacdbd t/01load.t
SHA1 02ef05af53cb7378452590324bb21dfe61f44069 t/02pod.t
SHA1 929a08bf0508c27e04e1a3a376c869a45751a388 t/03podcov.t
SHA1 63d3ac167c2d98484f521ad9cbddbf306d33d8eb t/Math/BigFloat/Subclass.pm
SHA1 309c0d093884f29111225c2108a33f0e8e028759 t/Math/BigInt/BareCalc.pm
SHA1 62deb0b9e3bf94aaf12745207efa3d858f3b878e t/Math/BigInt/Scalar.pm
SHA1 27c1738a064e7f7bf91c762d411af447847c331c t/Math/BigInt/Subclass.pm
SHA1 a2014803baec5dbef46235f83411f76efa0efea7 t/_e_math.t
SHA1 0e725849a20e80bb1da796a7be40b69a958c8313 t/alias.inc
SHA1 7f6941abb43f84eaffb8a65c78ddd0457175f39c t/bare_mbf.t
SHA1 2f18c703ef46afe813b9b8d68f43eca672fcfaab t/bare_mbi.t
SHA1 16793246cd5065cd487fcc62331651c5fc2cbabf t/bare_mif.t
SHA1 be61650d19d12797f0bd45d64a5dbae68f22f3ad t/bare_mbf.t
SHA1 b25611b9a4c78a20ad285fd2b68025ebfa57b4a9 t/bare_mbi.t
SHA1 97fb1db80aeb4ab007e2260d35329e149edf5e05 t/bare_mif.t
SHA1 333a425247b4e276696210a6322b815a0f55f5ab t/big_pi_e.t
SHA1 2e61614c1f9c2fa949ff5e9be114a1d33c48dab2 t/bigfltpm.inc
SHA1 e0151e25270c2b0a14955eafe15ab93977af447c t/bigfltpm.t
SHA1 6efb0fd844e25885c310eda19e57a797e127ebc9 t/bigintc.t
SHA1 63fd1d16538a881f04a53cda6752bfc24a482d82 t/bigintpm.inc
SHA1 77b20602f2f164be3d67d7fb8ee8e0bfe43f18d9 t/bigintpm.t
SHA1 03a9a3dde7d4fcc3eb2e8f245ab0b0253f1d5821 t/bigfltpm.inc
SHA1 a8f364fea5e2993f5ae7bd3f8463024175d33e24 t/bigfltpm.t
SHA1 b3ceebc429c05bce95347575d28348306dbcfcc8 t/bigintc.t
SHA1 108a20412616ea34d67b93891383d47e3a619120 t/bigintpm.inc
SHA1 e91b777f7c22648d8debaf4f663d519decda083b t/bigintpm.t
SHA1 cb07d195c20eb306088eeacccc2c7475f267446c t/bigints.t
SHA1 5bdf82ef7085b97caa496bfc71ab1fbfe48ef9e8 t/biglog.t
SHA1 da260b6e02b220868fc7b4c0f87569299402fbf7 t/bigroot.t
SHA1 52eac46ea148e3c83d78d316e7e3214a9f587365 t/calling.t
SHA1 2ed03baf88a7d868706605bada7874123f99eded t/calling.t
SHA1 c1f7b6840e772f2b6d4f8dbea4c28aaa675c9b17 t/config.t
SHA1 7c75531325efd55f15ef14e5ca22875d6d53e366 t/const_mbf.t
SHA1 b7891121243029ae078ca952205ce3d037b145d8 t/constant.t
......@@ -74,12 +78,10 @@ SHA1 95d41431bb5147f2cd97d2f160c1ce220a365142 t/lib_load.t
SHA1 18071d0caf17979c5345baf7b296a1e95d8f9bf1 t/mbf_ali.t
SHA1 79fafec237d6f47d8a176c67418f94c708ed3fec t/mbi_ali.t
SHA1 2b9490eab4d5371b804a39fb16e77c6bd6bbd006 t/mbi_rand.t
SHA1 0146ce0a49cef7277e3d009555b60401db222b27 t/mbimbf.inc
SHA1 1a0c8bf7ee5f1c11946974b0ecf4c04346621a33 t/mbimbf.t
SHA1 38d000d99cb2492ab518786e62ab1fae710e0f8d t/mbimbf.inc
SHA1 2709f7d1acdb39aab910d3ba4c88191b28cc3cfc t/mbimbf.t
SHA1 a8e152beb9c0583cca8ba397ca2952cf456f107c t/nan_cmp.t
SHA1 852bfc6c25fa982e0c48e270277f091732d062e2 t/new_overloaded.t
SHA1 354878333fc3c489b3b6ab73c2923abe81e0ec73 t/pod.t
SHA1 84b0d1a2d1efd60947ca444e59124b05d44e2e2b t/pod_cov.t
SHA1 4c28c03a8e373c03a0246548394588855e4173b9 t/req_mbf0.t
SHA1 1317f0500ac902cff77d78ea92b2b72dbf188331 t/req_mbf1.t
SHA1 4ce690af449cd6382b1372d4bacacb2781e91574 t/req_mbfa.t
......@@ -89,11 +91,11 @@ SHA1 ef3834f63ddf05286de80b1d7bb1fb420e117183 t/req_mbfw.t
SHA1 1bbe72733abd2f580f94b6a147672f7671260149 t/require.t
SHA1 ad6cc6fe4bb93ae78db4eb7dcb96c95024b963d2 t/round.t
SHA1 9d51def046889bf20c6ac2a278f9b3f5f8e36025 t/sub_ali.t
SHA1 1e536ee3c640adc80e60f42208a14703ae17d438 t/sub_mbf.t
SHA1 0122fe4c9ecb58e68df90168b2952275c7253af9 t/sub_mbi.t
SHA1 317dd7564b180f5d7b14e4dac64ee90f42317baa t/sub_mif.t
SHA1 26e2d4b13a44eaa38141a7c119a2737ba10ae88d t/sub_mbf.t
SHA1 2359c73586b352db6d7ceb631a0457029ef416c4 t/sub_mbi.t
SHA1 a9d994551c5ca127c11f5cdd1d8df1d93972c72c t/sub_mif.t
SHA1 22c563a6879c94ce7c8eb72c645f2e374837c34e t/trap.t
SHA1 f8bf42aefd7fed875e4bc6f9e0d3b0f8bf574049 t/upgrade.inc
SHA1 9438a430cebc43f4466b3d75662fe7dde577d3c7 t/upgrade.inc
SHA1 6d12a4d44729cf096c4a22935484ffe72055aaf8 t/upgrade.t
SHA1 e9019081ff5c07957e45619010c62a54472d8508 t/upgrade2.t
SHA1 49183118717b8b90e498b6d7b1ac0aa0e4d85894 t/upgradef.t
......@@ -103,11 +105,11 @@ SHA1 4959257dd52935cdfd17b132e11bcdb4e37752e9 t/use_lib2.t
SHA1 29606835c9d63a19075003429b00947b922ef144 t/use_lib3.t
SHA1 a5cc44a7e485828791696b2b27925e0d2855f883 t/use_lib4.t
SHA1 0c5f496ed66b02d0e118763c91862d84e3fb5629 t/use_mbfw.t
SHA1 a4034f7f505845dddaaea2540cd376ea66a8650d t/with_sub.t
SHA1 8e66591a9596ed344c09741a52ee5a54a4142dc6 t/with_sub.t
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Version: GnuPG v1.4.9 (Cygwin)
iEYEARECAAYFAkzYUnMACgkQdC8qQo5jWl45WQCfcrm062/ZzGiBJtDB/ZiPjCRT
hlYAnRPdE48m/lr7gq1J+I3sdyJ/q78Y
=YE5S
iEYEARECAAYFAk1pJTEACgkQVQvyyU1bchozxQCdHRkMh4YnXBqQ4a2UFNoy7/ax
OmMAn0qkQfRPM+cM0DxWAacR9T8SMg0d
=vyiu
-----END PGP SIGNATURE-----
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -5,7 +5,7 @@ use strict;
# use warnings; # dont use warnings for older Perls
use vars qw/$VERSION/;
$VERSION = '0.07';
$VERSION = '1.993';
package Math::BigInt;
......@@ -312,7 +312,7 @@ using a call to the native lib.
=head2 __emu_bior
=head1 LICENSE
This program is free software; you may redistribute it and/or modify it under
the same terms as Perl itself.
......
#!/usr/bin/perl -w
use strict; # restrict unsafe constructs
use Test::More;
if (!$ENV{TEST_SIGNATURE}) {
plan skip_all =>
"Set the environment variable TEST_SIGNATURE to enable this test.";
}
elsif (!eval { require Module::Signature; 1 }) {
plan skip_all =>
"Next time around, consider installing Module::Signature, ".
"so you can verify the integrity of this distribution.";
}
elsif (!-e 'SIGNATURE') {
plan skip_all => "SIGNATURE not found";
}
elsif (!-s 'SIGNATURE') {
plan skip_all => "SIGNATURE file empty";
}
elsif (!eval { require Socket; Socket::inet_aton('pool.sks-keyservers.net') }) {
plan skip_all => "Cannot connect to the keyserver to check module ".
"signature";
}
else {
plan tests => 1;
}
my $ret = Module::Signature::verify();
SKIP: {
skip "Module::Signature cannot verify", 1
if $ret eq Module::Signature::CANNOT_VERIFY();
cmp_ok $ret, '==', Module::Signature::SIGNATURE_OK(), "Valid signature";
}
#!/usr/bin/perl -w
use strict; # restrict unsafe constructs
use Test::More tests => 2;
BEGIN {
use_ok('Math::BigInt');
use_ok('Math::BigFloat');
};
diag("Testing Math::BigInt $Math::BigInt::VERSION");
diag("==> Perl $], $^X");
#!/usr/bin/perl -w
use strict; # restrict unsafe constructs
use Test::More;
# Ensure a recent version of Test::Pod
my $min_tp = 1.22;
eval "use Test::Pod $min_tp";
plan skip_all => "Test::Pod $min_tp required for testing POD" if $@;
all_pod_files_ok();
#!/usr/bin/perl -w
use strict; # restrict unsafe constructs
use Test::More;
# Ensure a recent version of Test::Pod::Coverage
my $min_tpc = 1.08;
eval "use Test::Pod::Coverage $min_tpc";
plan skip_all => "Test::Pod::Coverage $min_tpc required for testing POD coverage"
if $@;
# Test::Pod::Coverage doesn't require a minimum Pod::Coverage version,
# but older versions don't recognize some common documentation styles
my $min_pc = 0.18;
eval "use Pod::Coverage $min_pc";
plan skip_all => "Pod::Coverage $min_pc required for testing POD coverage"
if $@;
plan tests => 2;
my $trustme;
$trustme = {
trustme => [ 'fround', 'objectify' ],
};
pod_coverage_ok( 'Math::BigInt', $trustme, "All our Math::BigInts are covered" );
$trustme = {
trustme => [ 'DEBUG', 'isa' ],
coverage_class => 'Pod::Coverage::CountParents',
};
pod_coverage_ok( 'Math::BigFloat', $trustme, "All our Math::BigFloats are covered" );
#!/usr/bin/perl -w
use strict;
use Test::More tests => 2319;
use Test::More tests => 2322;
BEGIN { unshift @INC, 't'; }
......
#!/usr/bin/perl -w
use strict;
use Test::More tests => 3279;
use Test::More tests => 3619;
BEGIN { unshift @INC, 't'; }
......
#!/usr/bin/perl -w
# test rounding, accuracy, precicion and fallback, round_mode and mixing
# test rounding, accuracy, precision and fallback, round_mode and mixing
# of classes under BareCalc
use strict;
......
......@@ -210,9 +210,9 @@ is ($y,1200); is ($x,1200);
my $monster = '1e1234567890123456789012345678901234567890';
# new and exponent
is ($class->new($monster)->bsstr(),
is ($class->new($monster)->bsstr(),
'1e+1234567890123456789012345678901234567890');
is ($class->new($monster)->exponent(),
is ($class->new($monster)->exponent(),
'1234567890123456789012345678901234567890');
# cmp
is ($class->new($monster) > 0,1);
......@@ -224,7 +224,7 @@ is ($class->new($monster)->bmul(2)->bsstr(),
# mantissa
$monster = '1234567890123456789012345678901234567890e2';
is ($class->new($monster)->mantissa(),
is ($class->new($monster)->mantissa(),
'123456789012345678901234567890123456789');
###############################################################################
......@@ -590,6 +590,7 @@ fnormNaN:NaN
-inf:-inf
inf:inf
NaN:NaN
71243225429896467497217836789578596379:71243225429896467497217836789578596379
# test for bug in brsft() not handling cases that return 0
0.000641:0
0.0006412:0
......@@ -725,7 +726,7 @@ abc:NaN
-123456E-2:-1234.56
1e1:10
2e-11:0.00000000002
# excercise _split
# exercise _split
.02e-1:0.002
000001:1
-00001:-1
......@@ -1063,6 +1064,8 @@ fcmpNaN:+0:
2:1.5:1
1.54321:234:-1
234:1.54321:1
1e1234567890987654321:1e1234567890987654320:1
1e-1234567890987654321:1e-1234567890987654320:-1
# infinity
-inf:5432112345:-1
+inf:5432112345:1
......@@ -1506,7 +1509,7 @@ inf:inf:NaN
inf:-inf:NaN
8:0:8
inf:0:inf
# exceptions to reminder rule
# exceptions to remainder rule
-inf:0:-inf
-8:0:-8
0:0:NaN
......
#!/usr/bin/perl -w
use strict;
use Test::More tests => 2319
use Test::More tests => 2322
+ 5; # own tests
......
......@@ -148,8 +148,8 @@ foreach (qw/ 1 12 123 1234 12345 123456 1234567 12345678 123456789/)
# _zeros
$x = $C->_new("1256000000"); is ($C->_zeros($x),6);
$x = $C->_new("152"); is ($C->_zeros($x),0);
$x = $C->_new("123000"); is ($C->_zeros($x),3);
$x = $C->_new("0"); is ($C->_zeros($x),0);
$x = $C->_new("123000"); is ($C->_zeros($x),3);
$x = $C->_new("0"); is ($C->_zeros($x),0);
# _lsft, _rsft
$x = $C->_new("10"); $y = $C->_new("3");
......@@ -313,7 +313,7 @@ $x = $C->_new("11"); is ($C->_str($C->_fac($x)),'39916800');
$x = $C->_new("12"); is ($C->_str($C->_fac($x)),'479001600');
$x = $C->_new("13"); is ($C->_str($C->_fac($x)),'6227020800');
# test that _fac modifes $x in place for small arguments
# test that _fac modifies $x in place for small arguments
$x = $C->_new("3"); $C->_fac($x); is ($C->_str($x),'6');
$x = $C->_new("13"); $C->_fac($x); is ($C->_str($x),'6227020800');
......
......@@ -198,7 +198,7 @@ while (<DATA>)
}
if ($ans eq "")
{
is ($ans1, undef);
is ($ans1, undef);
}
else
{
......@@ -545,11 +545,11 @@ $x -= 1; is ($x,$MAX); is_valid($x); # 9999 again
###############################################################################
# check numify
$x = $class->new($BASE-1); is ($x->numify(),$BASE-1);
$x = $class->new(-($BASE-1)); is ($x->numify(),-($BASE-1));
$x = $class->new($BASE-1); is ($x->numify(),$BASE-1);
$x = $class->new(-($BASE-1)); is ($x->numify(),-($BASE-1));
# +0 is to protect from 1e15 vs 100000000 (stupid to_string aaaarglburblll...)
$x = $class->new($BASE); is ($x->numify()+0,$BASE+0);
$x = $class->new($BASE); is ($x->numify()+0,$BASE+0);
$x = $class->new(-$BASE); is ($x->numify(),-$BASE);
$x = $class->new( -($BASE*$BASE*1+$BASE*1+1) );
is ($x->numify(),-($BASE*$BASE*1+$BASE*1+1));
......@@ -895,7 +895,7 @@ NaN:-inf:
0b100000000000000000000000000000001:4294967297
0b1000000000000000000000000000000001:8589934593
0b10000000000000000000000000000000001:17179869185
0b_101:NaN
0b__101:NaN
0b1_0_1:5
0b0_0_0_1:1
# hex input
......@@ -908,7 +908,7 @@ NaN:-inf:
0x12345678:305419896
0x1_2_3_4_56_78:305419896
0xa_b_c_d_e_f:11259375
0x_123:NaN
0x__123:NaN
0x9:9
0x11:17
0x21:33
......@@ -1541,7 +1541,7 @@ inf:inf:NaN,NaN
inf:-inf:NaN,NaN
8:0:inf,8
inf:0:inf,inf
# exceptions to reminder rule
# exceptions to remainder rule
-8:0:-inf,-8
-inf:0:-inf,-inf
0:0:NaN,NaN
......@@ -1672,7 +1672,7 @@ inf:0:inf
84696969696969696943434343434871161616161616161452525252486813131313131313143230042929292929292930:13131313131313131313131313131394949494949494949494949494943535353535353535353535:6449999999999999998
84696969696969696969696969697497424242424242424242424242385803030303030303030300750000000000000000:13131313131313131313131313131394949494949494949494949494943535353535353535353535:6450000000000000000
84696969696969696930303030303558030303030303030057575757537318181818181818199694689393939393939395:13131313131313131313131313131394949494949494949494949494943535353535353535353535:6449999999999999997
# excercise shortcut for numbers of the same length in div
# exercise shortcut for numbers of the same length in div
999999999999999999999999999999999:999999999999999999999999999999999:1
999999999999999999999999999999999:888888888888888888888888888888888:1
999999999999999999999999999999999:777777777777777777777777777777777:1
......@@ -1704,13 +1704,34 @@ abc:5:NaN
# bmodinv Expected Results from normal use
1:5:1
3:5:2
3:-5:-3
-2:5:2
8:5033:4404
1234567891:13:6
-1234567891:13:7
324958749843759385732954874325984357439658735983745:2348249874968739:1741662881064902
-2:1:0
-1:1:0
0:1:0
1:1:0
2:1:0
3:1:0
4:1:0
-2:3:1
-1:3:2
0:3:NaN
1:3:1
2:3:2
3:3:NaN
4:3:1
-2:4:NaN
-1:4:3
0:4:NaN
1:4:1
2:4:NaN
3:4:3
4:4:NaN
## bmodinv Error cases / useless use of function
3:-5:NaN
inf:5:NaN
5:inf:NaN
-inf:5:NaN
......@@ -1725,16 +1746,165 @@ abc:abc:5:NaN
5:5:abc:NaN
5:abc:5:NaN
abc:5:5:NaN
3:5:0:NaN
# bmodpow Expected results
0:0:2:1
1:0:2:1
0:3:5:0
-2:-2:1:0
-1:-2:1:0
0:-2:1:0
1:-2:1:0
2:-2:1:0
3:-2:1:0
4:-2:1:0
-2:-1:1:0
-1:-1:1:0
0:-1:1:0
1:-1:1:0
2:-1:1:0
3:-1:1:0
4:-1:1:0
-2:0:1:0
-1:0:1:0
0:0:1:0
8:7:5032:3840
1:0:1:0
2:0:1:0
3:0:1:0
4:0:1:0
-2:1:1:0
-1:1:1:0
0:1:1:0
1:1:1:0
2:1:1:0
3:1:1:0
4:1:1:0
-2:2:1:0
-1:2:1:0
0:2:1:0
1:2:1:0
2:2:1:0
3:2:1:0
4:2:1:0
-2:3:1:0
-1:3:1:0
0:3:1:0
1:3:1:0
2:3:1:0
3:3:1:0
4:3:1:0
-2:4:1:0
-1:4:1:0
0:4:1:0
1:4:1:0
2:4:1:0
3:4:1:0
4:4:1:0
-2:-2:3:1
-1:-2:3:1
0:-2:3:NaN
1:-2:3:1
2:-2:3:1
3:-2:3:NaN
4:-2:3:1
-2:-1:3:1
-1:-1:3:2
0:-1:3:NaN
1:-1:3:1
2:-1