Commit 858d434f authored by gregor herrmann's avatar gregor herrmann

Imported Upstream version 1.999717

parent 504c2c7b
......@@ -1360,7 +1360,8 @@ The changes are now grouped by distribution.
$x->bdiv($y) in list context should return quotient $q and remainder $r so
that $x = $q * $y + $r, and that the remainder (modulo) $r should correspond
to Perl's % operator as well as the bmod() method. This has not been the
actual behaviour. This is now fixed.
actual behaviour. This is now fixed. In scalar context, only the quotient is
returned.
* Clearer POD documentation for the bdiv() and bmod() methods.
......@@ -1627,7 +1628,7 @@ there are so many changes, I let this be a development release.
* Add tests for as_oct().
* Minor simplifications in Math::BigInt->as_oct() as
* Minor simplifications in Math::BigInt->as_oct() and
Math::BigInt::Calc::_as_oct().
2016-01-05 v1.999715 pjacklam
......@@ -1643,6 +1644,40 @@ there are so many changes, I let this be a development release.
* Wrap long line in the CHANGES file.
2016-04-03 v1.999716 pjacklam
* $x->new(...) can no longer be used to assign a value to $x. This was a
mistake introduced in v1.999712. As the name "new" implies, it should always
return a new object.
* Using new() with no argument no longer gives a warning. This use has been
discouraged, in favour of bzero(), for many years, but people are still
using it, so I am reintroducing the support for this.
* Added btdiv() and btmod() for truncated division (T-division) and ditto
remainder. Add tests.
* Add test files author-bmod-bdiv-mbi.t author-btmod-btdiv-mbi.t with more
thorough testing of bdiv(), bmod(), btdiv(), and btmod().
* When new() is used as an instance method, the new object is initialized as a
copy of the invocand.
* Move test for numfiy() of +Inf, -Inf, NaN, and big integers from
bigfltpm.inc and bigintpm.inc into author-numify-mbi.t and
author-numify-mbf.t.
* Improved wording and fixed typos in earlier changelog entries.
2016-04-16 v1.999717 pjacklam
* Using new() with an undefined argument no longer gives a warning. Explicit
use of this is discouraged, but it is sometimes used by the modules
themselves issuing warnings that is confusing to the end user. Just
uncomment the code, since we plan to reintroduce this warning later.
* Avoid using L<> around e-mail addressess in POD.
Please send us test-reports, your experiences with this and your ideas - we love
to hear about our work!
......
......@@ -36,7 +36,11 @@ t/author-batan2-mbf.t
t/author-bexp-mbf.t
t/author-blog-mbf.t
t/author-blog-mbi.t
t/author-bmod-bdiv-mbi.t
t/author-bpi-mbf.t
t/author-btmod-btdiv-mbi.t
t/author-numify-mbf.t
t/author-numify-mbi.t
t/bare_mbf.t
t/bare_mbi.t
t/bare_mif.t
......
......@@ -40,6 +40,6 @@
}
},
"release_status" : "stable",
"version" : "1.999715",
"version" : "1.999717",
"x_serialization_backend" : "JSON::PP version 2.27300"
}
......@@ -22,5 +22,5 @@ requires:
Math::Complex: '1.39'
Test::More: '0.9301'
perl: '5.006001'
version: '1.999715'
x_serialization_backend: 'CPAN::Meta::YAML version 0.016'
version: '1.999717'
x_serialization_backend: 'CPAN::Meta::YAML version 0.018'
......@@ -16,15 +16,15 @@ Hash: SHA1
SHA1 f6ef98e8f3f6a4f670d569f279ef5a3c05c16d0c BENCHMARK
SHA1 d681b992c9e027633a59fbd52530805ee4e1621c BUGS
SHA1 56305ead4acbfba4cd2ad75bd300348880d7e84e CHANGES
SHA1 beb9a00eb1e0c02cceccc6e8fad8c09d9fedc1b8 CHANGES
SHA1 f27c8bd98e754f96c9825fa6ce9f1244c93bdbe6 CREDITS
SHA1 bc2db74538d3acd53f71b5512a144fe18c253ecd GOALS
SHA1 fe61299e80a1dca48fbaa33f0869e3238ec07c70 HISTORY
SHA1 d6a6c30ee6d9ba6b9afab8bbf6a25e1b23c744e0 LICENSE
SHA1 528e7714188e2467c521b4a42cdef9af57ae84a2 MANIFEST
SHA1 0b2778f87928d0529a0119f1f7d79f4d02416b3e MANIFEST
SHA1 86df44fbe1ea7a68897113f0e327d0f0c25b91e3 MANIFEST.SKIP
SHA1 24b4f9de847ad57e5279ed66a02d18ae39658f24 META.json
SHA1 68078ebf5d437da92e7ea68bf2dff17f9d52ffcc META.yml
SHA1 f2acf19f0a04de72c508126ce6047a6228b18460 META.json
SHA1 80050f505f12679a9e5d8227fcc25b5d94a432ae META.yml
SHA1 2b614d9027b35fcc411dbb248c0ab3338ee3430f Makefile.PL
SHA1 4e2191d1724e699862efc5350f480c8e02755112 NEW
SHA1 813c62e6d3edd18b7b634765ecbd75b2cd6389a0 README
......@@ -40,10 +40,10 @@ 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 6c40c07f32ee38ddb3e900f10f4751fa6dacf035 lib/Math/BigFloat.pm
SHA1 27a66c373f3c0a5ae198afe788b559cd361fa1a7 lib/Math/BigInt.pm
SHA1 0807737d74be329e4251a2abd4914587a5c34e2a lib/Math/BigInt/Calc.pm
SHA1 9e774f501bd57f96b27d18cd4342708738e46ee4 lib/Math/BigInt/CalcEmu.pm
SHA1 2a731e6d082c83e86dfe994de245758d0030c79f lib/Math/BigFloat.pm
SHA1 4d8eae5eb1e8101911ec8dfaf3505f93266cfa11 lib/Math/BigInt.pm
SHA1 f048fd4817f110f6a4403ca6b7b67aaa42984aeb lib/Math/BigInt/Calc.pm
SHA1 5acf461aea7f629bb7633dbe6e9afa8210f2796e lib/Math/BigInt/CalcEmu.pm
SHA1 385cc7ed3bf3e6290640b9880445ca9a3dea629e t/00sig.t
SHA1 551efa40942b38f7f521b5a511d08f29ef7b4a1b t/01load.t
SHA1 b2ed9206ca5b69ec3b8bbf850bf4b6dfde518e7e t/02pod.t
......@@ -59,20 +59,24 @@ SHA1 d6dd884fbd6cc3f8967dc5426e0c2c6f81f21e5b t/author-batan2-mbf.t
SHA1 4c66c320be87292fb55149be8dd8545fb3a13d2c t/author-bexp-mbf.t
SHA1 843080d13c065d28a7186d1fc46a982b84b9f753 t/author-blog-mbf.t
SHA1 a904010b47c4ad7e9f117d4a3ff80a3dbee493c0 t/author-blog-mbi.t
SHA1 52afa136d4ae7b722fd7b5aceb4b8aa005e91d49 t/author-bmod-bdiv-mbi.t
SHA1 1b60e86b66129b2fd448e004a5f59451b875aa97 t/author-bpi-mbf.t
SHA1 bcf026322605f19424ffe38652f0d13900d5d93f t/bare_mbf.t
SHA1 b79615b536dc8573dc1d37fe4f3bfb31632879e4 t/bare_mbi.t
SHA1 006d5e0e87f0a7ede7553e099037b379a44e29ae t/author-btmod-btdiv-mbi.t
SHA1 ac380f54837ab5dc30aaffebc5c6448682ed9da3 t/author-numify-mbf.t
SHA1 1c802f655752fcb0784338f1289fdc02445513ad t/author-numify-mbi.t
SHA1 83e4afc42ff51dd654868074ada5b210d19f62fc t/bare_mbf.t
SHA1 5296708c577f3be9b1c198861d6b652d19a8aaf4 t/bare_mbi.t
SHA1 78f469179800adf4a43ac18997b15c345b186911 t/bare_mif.t
SHA1 d280a166a98ea682d019e0d83699590812a374a9 t/big_pi_e.t
SHA1 9b9b6a30c74d5134a6ad4a04b71732d9802dfd64 t/bigfltpm.inc
SHA1 84294919a46d123df0d0c581c17a079503d46636 t/bigfltpm.t
SHA1 97b90e124d418fbbbd025cb6cf6a44eb024e4fca t/bigfltpm.inc
SHA1 12d984137951ce6307b13a087354764f6b700e96 t/bigfltpm.t
SHA1 6b9090d78157541f539b2bfbd8bf25a9066857a7 t/bigintc.t
SHA1 8196aa86f15868a91cde4ca849b1035cfee856dd t/bigintpm.inc
SHA1 e69dbf31bd6a8ca43ae6a6746b53a1b8bec9c9e7 t/bigintpm.t
SHA1 4962d50d538ec515c1dc33b87659de906ab1ba5b t/bigintpm.inc
SHA1 9b543289045f977c8a77dbb2090f61c9e0751f17 t/bigintpm.t
SHA1 9aac2eda0e723298c8f9ddadffde39a8c16fb171 t/bigints.t
SHA1 89e6c8b733ae772b7096a9edab565c4034686951 t/biglog.t
SHA1 1ff35e339b269f853106accb80c5d7ecc46e10e4 t/bigroot.t
SHA1 7edc2e0f720f997fe98fb33b117e64736646051b t/calling.t
SHA1 b2823a8562cf23ccdd74f8d2509181745a336232 t/calling.t
SHA1 c403d1c64ae6c3b803fc8cd0d10a1df15219057f t/config.t
SHA1 af01ecfb6f43bb518c67185eb063c196e2dbdc48 t/const_mbf.t
SHA1 17eb15c35392945a5b3ed2b711f7d166fca294de t/constant.t
......@@ -100,8 +104,8 @@ SHA1 abd2976a775e8ae3c5408b4bcc9d85e3894a63e5 t/require.t
SHA1 10c532f2fbf6cfc4d13d56d7ef908babc84546ec t/round.t
SHA1 d4dc89382fcdc28f4a2a70eacb8204445b327072 t/rt-16221.t
SHA1 ab253275ec4288308f6ea6ecf0744e24cb3c356a t/sub_ali.t
SHA1 34553ea2c707f8b5fc9034772f779aac7b016b72 t/sub_mbf.t
SHA1 09bb3e7ff5b8b6fb42aceb0bd12117c47a52fab1 t/sub_mbi.t
SHA1 e3b7bb2dee4368d5a82da7ce0d4b2dfeb5c15872 t/sub_mbf.t
SHA1 c5d499796b7ceafad0e228828619514df4773df4 t/sub_mbi.t
SHA1 071d33db8604633797b69de80bad101c88995985 t/sub_mif.t
SHA1 e0e51c7818998491720933075be68817cc7aa55f t/trap.t
SHA1 1540d1deeab9339aac365df76a3dd2d8f976e5a2 t/upgrade.inc
......@@ -114,15 +118,15 @@ SHA1 76aa88ab0694bd79c476a80105815335ab483fcc t/use_lib2.t
SHA1 121fa9e1674756d3301938aba12cc9346d3d7d48 t/use_lib3.t
SHA1 ab18e2d41140409d5e3740ae5cab986411651c43 t/use_lib4.t
SHA1 1c44b96dea3e068a41e0a8f28977e3c3193f859c t/use_mbfw.t
SHA1 3c213bb219bcbfbfba0f0455ab69e5895e25dfe2 t/with_sub.t
SHA1 20676f3f6045091ed6247a4f91b53c19778c55bf t/with_sub.t
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
iQEcBAEBAgAGBQJWi97UAAoJEGcmPl2fr166IhMH/Rpijmbg4Ewdr/QhbyWlR6yM
fiyDkXj/zl+pz7QbDtk5mOnZq/e4Vg5ue/VilaYt80Ocr+TFL6dtSM1PVIg2r5ac
0nDqnN+r10L9lwFX593gJxFv8QPlCgu2sSiEqT9XWAQ+KfIC/EwX3NvTetSQB8Fk
+lEP4sMDeGRDEYH/B37SK4gicOX76aggTEuEz3XQba8TXSoHUnwSR8XbdyzfrgpZ
lDDZVGB87CglhoqYtxs9S9Vw3lNXIF7LcU9cC/lReZpmjKedq3E8P90LPIJe2r9r
k4lrmriHo5r7dU/THeAh1mTbzfkFhdxyU+WyW9m3Nd2DgDfAcMWGRW/RlxqEnz4=
=agTs
iQEcBAEBAgAGBQJXEhONAAoJEGcmPl2fr166GZwH/iYnR15//lztfwzjvpzr4xRe
yNuPwFwWUi1Kv09EeE7RdS3w+kYt3kvAYKax0jgGs6qiLvrGZk84lEp2rwF44g/6
t7C/mkRSHQiojQMde0ZpSxlt5lC6B1HkRXdNikvPlMf/C3ZrqO2GytHl/afxGXxO
Shb1OPH5APNYfUuPbqM+1vBvD1iOGHOD1vpg70WGTiPtfW33Dl7eU3VFDW6L1h3+
t3L/R0s7JLCcTHckIsal2TEbpMz9LSkfLakchOPmhtBzOEXB97Dupjm1qD+YU7RE
QCA8bZEFcDjqzjEoBFA6WMPY/Z9JMijmABgCHAS82ECui/9YeMkUV2MvsH2+EcU=
=rHXx
-----END PGP SIGNATURE-----
......@@ -16,7 +16,7 @@ use 5.006001;
use strict;
use warnings;
our $VERSION = '1.999715';
our $VERSION = '1.999717';
$VERSION = eval $VERSION;
require Exporter;
......@@ -141,8 +141,8 @@ sub new {
# avoid numify-calls by not using || on $wanted!
unless (defined $wanted) {
require Carp;
Carp::carp("Use of uninitialized value in new");
#require Carp;
#Carp::carp("Use of uninitialized value in new");
return $self->bzero(@r);
}
......@@ -5124,11 +5124,11 @@ Completely rewritten by Tels L<http://bloodgate.com> in 2001-2008.
=item *
Florian Ragwitz L<flora@cpan.org>, 2010.
Florian Ragwitz E<lt>flora@cpan.orgE<gt>, 2010.
=item *
Peter John Acklam, L<pjacklam@online.no>, 2011-.
Peter John Acklam E<lt>pjacklam@online.noE<gt>, 2011-.
=back
......
This diff is collapsed.
......@@ -4,7 +4,7 @@ use 5.006001;
use strict;
use warnings;
our $VERSION = '1.999715';
our $VERSION = '1.999717';
$VERSION = eval $VERSION;
# Package to store unsigned big integers in decimal and do math with them
......
......@@ -4,7 +4,7 @@ use 5.006001;
use strict;
use warnings;
our $VERSION = '1.999715';
our $VERSION = '1.999717';
$VERSION = eval $VERSION;
package Math::BigInt;
......
This diff is collapsed.
This diff is collapsed.
#!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 Math::BigFloat;
use Test::More tests => 9;
use Math::Complex;
my $inf = Math::Complex::Inf();
my $nan = $inf - $inf;
###############################################################################
# Check numify() on finite values.
{
my $x = Math::BigFloat -> new("0.008");
my $y = Math::BigFloat -> new(2);
$x -> bdiv(3, $y);
cmp_ok($x, "==", "0.0027",
qq|\$x = Math::BigFloat -> new("0.008");|
. qq| \$y = Math::BigFloat -> new(2); \$x -> bdiv(3, \$y);|);
cmp_ok(Math::BigFloat -> new("12345e67") -> numify(), "==", 1.2345e71,
qq|Math::BigFloat -> new("12345e67") -> numify()|);
}
###############################################################################
# Verify that numify() underflows and overflows when given "extreme" values.
# positive overflow
cmp_ok(Math::BigFloat -> new("1e9999") -> numify(), "==", $inf,
qq|Math::BigFloat -> new("1e9999") -> numify()|);
# negative overflow
cmp_ok(Math::BigFloat -> new("-1e9999") -> numify(), "==", -$inf,
qq|Math::BigFloat -> new("-1e9999") -> numify()|);
# positive underflow
cmp_ok(Math::BigFloat -> new("1e-9999") -> numify(), "==", 0,
qq|Math::BigFloat -> new("1e-9999") -> numify()|);
# negative underflow
cmp_ok(Math::BigFloat -> new("-1e-9999") -> numify(), "==", 0,
qq|Math::BigFloat -> new("-1e-9999") -> numify()|);
###############################################################################
# Check numify on non-finite objects.
is(Math::BigFloat -> binf("+") -> numify(), $inf, "numify of +Inf");
is(Math::BigFloat -> binf("-") -> numify(), -$inf, "numify of -Inf");
is(Math::BigFloat -> bnan() -> numify(), $nan, "numify of NaN");
#!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 Math::BigInt;
use Test::More tests => 14;
use Math::Complex;
my $inf = Math::Complex::Inf();
my $nan = $inf - $inf;
###############################################################################
# Check numify() on finite values.
cmp_ok(Math::BigInt -> bzero() -> numify(), "==", 0,
'Math::BigInt -> bzero() -> numify()');
cmp_ok(Math::BigInt -> bone() -> numify(), "==", 1,
'Math::BigInt -> bone() -> numify()');
cmp_ok(Math::BigInt -> new("4711") -> numify(), "==", 4711,
'Math::BigInt -> new("4711") -> numify()');
cmp_ok(Math::BigInt -> new("-4711") -> numify(), "==", -4711,
'Math::BigInt -> new("-4711") -> numify()');
cmp_ok(Math::BigInt -> new("12345e67") -> numify(), "==", 12345e67,
qq|Math::BigInt -> new("12345e67") -> numify()|);
###############################################################################
# Verify that numify() overflows when given "extreme" values.
# positive overflow
is(Math::BigInt -> new("1e9999") -> numify(), $inf,
qq|Math::BigInt -> new("1e9999") -> numify()|);
# negative overflow
is(Math::BigInt -> new("-1e9999") -> numify(), -$inf,
qq|Math::BigInt -> new("-1e9999") -> numify()|);
###############################################################################
# Check numify on non-finite objects.
is(Math::BigInt -> binf("+") -> numify(), $inf, "numify of +Inf");
is(Math::BigInt -> binf("-") -> numify(), -$inf, "numify of -Inf");
is(Math::BigInt -> bnan() -> numify(), $nan, "numify of NaN");
###############################################################################
skip("insufficient 64 bit integer support", 4)
unless ($Config::Config{ptrsize} == 8 &&
$] >= 5.008 &&
($Config::Config{use64bitint} ||
$Config::Config{use64bitall}));
# The following should not give "1.84467440737096e+19".
{
my $x = Math::BigInt -> new(2) -> bpow(64) -> bdec();
is($x -> bstr(), "18446744073709551615",
"Math::BigInt 2**64-1 as string");
is($x -> numify(), "18446744073709551615",
"Math::BigInt 2**64-1 as number");
}
# The following should not give "-9.22337203685478e+18".
{
my $x = Math::BigInt -> new(2) -> bpow(63) -> bneg();
is($x -> bstr(), "-9223372036854775808",
"Math::BigInt -2**63 as string");
is($x -> numify(), "-9223372036854775808",
"Math::BigInt -2**63 as number");
}
......@@ -3,7 +3,7 @@
use strict;
use warnings;
use Test::More tests => 2409;
use Test::More tests => 2406;
use lib 't';
......
......@@ -3,7 +3,7 @@
use strict;
use warnings;
use Test::More tests => 3724; # tests in require'd file
use Test::More tests => 3913; # tests in require'd file
use lib 't';
......
......@@ -283,18 +283,6 @@ like($CLASS->new("1e-9999")->numify(), qr/^\+?0$/,
unlike($CLASS->new("1e9999")->numify(), qr/^1(\.0*)?e\+?9+$/,
qq|$CLASS->new("1e9999")->numify()|);
###############################################################################
# Check numify on non-finite objects.
{
require Math::Complex;
my $inf = Math::Complex::Inf();
my $nan = $inf - $inf;
is($CLASS -> binf("+") -> numify(), $inf, "numify of +Inf");
is($CLASS -> binf("-") -> numify(), -$inf, "numify of -Inf");
is($CLASS -> bnan() -> numify(), $nan, "numify of NaN");
}
###############################################################################
# bsqrt() with set global A/P or A/P enabled on $x, also a test whether bsqrt()
# correctly modifies $x
......
......@@ -3,7 +3,7 @@
use strict;
use warnings;
use Test::More tests => 2409 # tests in require'd file
use Test::More tests => 2406 # tests in require'd file
+ 5; # tests in this file
use Math::BigInt lib => 'Calc';
......
......@@ -110,16 +110,20 @@ while (<DATA>) {
} elsif ($f eq "bacmp") {
$try .= ' $x->bacmp($y);';
} elsif ($f eq "badd") {
$try .= ' $x + $y;';
$try .= ' $x->badd($y);';
} elsif ($f eq "bsub") {
$try .= ' $x - $y;';
$try .= ' $x->bsub($y);';
} elsif ($f eq "bmul") {
$try .= ' $x * $y;';
$try .= ' $x->bmul($y);';
} elsif ($f eq "bdiv") {
$try .= ' $x / $y;';
$try .= ' $x->bdiv($y);';
} elsif ($f eq "bdiv-list") {
$try .= ' join (",", $x->bdiv($y));';
# overload via x=
} elsif ($f eq "btdiv") {
$try .= ' $x->btdiv($y);';
} elsif ($f eq "btdiv-list") {
$try .= ' join (",", $x->btdiv($y));';
# overload via x=
} elsif ($f =~ /^.=$/) {
$try .= " \$x $f \$y;";
# overload via x
......@@ -652,18 +656,6 @@ $x = 8 - $x; # 5 - 8 instead of 8 - 5
is($x, -3, '$x = Math::Foo->new(5); $x = 8 - $x; $x = -3');
is(ref($x), 'Math::Foo', '$x is an object of class "Math::Foo"');
###############################################################################
# Check numify on non-finite objects.
{
require Math::Complex;
my $inf = Math::Complex::Inf();
my $nan = $inf - $inf;
is($CLASS -> binf("+") -> numify(), $inf, "numify of +Inf");
is($CLASS -> binf("-") -> numify(), -$inf, "numify of -Inf");
is($CLASS -> bnan() -> numify(), $nan, "numify of NaN");
}
###############################################################################
# Test whether +inf eq inf
#
......@@ -1844,43 +1836,83 @@ NaNmul:-inf:NaN
9999999999999999999:10000000000000000000:99999999999999999990000000000000000000
&bdiv-list
100:20:5,0
4095:4095:1,0
-4095:-4095:1,0
4095:-4095:-1,0
-4095:4095:-1,0
123:2:61,1
9:5:1,4
9:4:2,1
# inf handling and general remainder
5:8:0,5
0:8:0,0
11:2:5,1
11:-2:-6,-1
-11:2:-6,1
# see table in documentation in MBI
0:inf:0,0
0:-inf:0,0
5:inf:0,5
5:-inf:-1,-inf
-5:inf:-1,inf
-5:-inf:0,-5
inf:5:inf,NaN
-inf:5:-inf,NaN
# Divide by zero and modulo zero.
inf:0:inf,inf
5:0:inf,5
0:0:NaN,0
-5:0:-inf,-5
-inf:0:-inf,-inf
# Numerator (dividend) is +/-inf, and denominator is finite and non-zero.
inf:-inf:NaN,NaN
inf:-5:-inf,NaN
-inf:-5:inf,NaN
5:5:1,0
-5:-5:1,0
inf:5:inf,NaN
inf:inf:NaN,NaN
-inf:-inf:NaN,NaN
-inf:-5:inf,NaN
-inf:5:-inf,NaN
-inf:inf:NaN,NaN
inf:-inf:NaN,NaN
8:0:inf,8
inf:0:inf,inf
# exceptions to remainder rule
-8:0:-inf,-8
-inf:0:-inf,-inf
0:0:NaN,0
# Denominator (divisor) is +/-inf. The cases when the numerator is +/-inf
# are covered above.
-5:inf:-1,inf
0:inf:0,0
5:inf:0,5
-5:-inf:0,-5
0:-inf:0,0
5:-inf:-1,-inf
# Numerator is finite, and denominator is finite and non-zero.
-5:-5:1,0
-5:-2:2,-1
-5:-1:5,0
-5:1:-5,0
-5:2:-3,1
-5:5:-1,0
-2:-5:0,-2
-2:-2:1,0
-2:-1:2,0
-2:1:-2,0
-2:2:-1,0
-2:5:-1,3
-1:-5:0,-1
-1:-2:0,-1
-1:-1:1,0
-1:1:-1,0
-1:2:-1,1
-1:5:-1,4
0:-5:0,0
0:-2:0,0
0:-1:0,0
0:1:0,0
0:2:0,0
0:5:0,0
1:-5:-1,-4
1:-2:-1,-1
1:-1:-1,0
1:1:1,0
1:2:0,1
1:5:0,1
2:-5:-1,-3
2:-2:-1,0
2:-1:-2,0
2:1:2,0
2:2:1,0
2:5:0,2
5:-5:-1,0
5:-2:-3,-1
5:-1:-5,0
5:1:5,0
5:2:2,1
5:5:1,0
# test the shortcut in Calc if @$x == @$yorg
1234567812345678:123456712345678:10,688888898
12345671234567:1234561234567:10,58888897
......@@ -1916,32 +1948,42 @@ inf:0:inf,inf
9999999_9999999_9999999_9999999:1_0000000_0000000_0000000:9999999,999999999999999999999
&bdiv
abc:abc:NaN
abc:1:NaN
1:abc:NaN
# Divide by zero and modulo zero.
inf:0:inf
5:0:inf
0:0:NaN
# inf handling (see table in doc)
-5:0:-inf
-inf:0:-inf
# Numerator (dividend) is +/-inf, and denominator is finite and non-zero.
inf:-inf:NaN
inf:-5:-inf
inf:5:inf
inf:inf:NaN
-inf:-inf:NaN
-inf:-5:inf
-inf:5:-inf
-inf:inf:NaN
# Denominator (divisor) is +/-inf. The cases when the numerator is +/-inf
# are covered above.
-5:inf:-1
0:inf:0
0:-inf:0
5:inf:0
5:-inf:-1
-5:inf:-1
-5:-inf:0
inf:5:inf
-inf:5:-inf
inf:-5:-inf
-inf:-5:inf
0:-inf:0
5:-inf:-1
# Numerator is finite, and denominator is finite and non-zero.
5:5:1
-5:-5:1
inf:inf:NaN
-inf:-inf:NaN
-inf:inf:NaN
inf:-inf:NaN
8:0:inf
inf:0:inf
-8:0:-inf
-inf:0:-inf
0:0:NaN
11:2:5
-11:-2:5
-11:2:-6
......@@ -2033,6 +2075,164 @@ inf:0:inf
# bug with shortcut in Calc 0.44
949418181818187070707070707070707070:181818181853535353535353535353535353:5
&btdiv-list
# Divide by zero and modulo zero.
inf:0:inf,inf
5:0:inf,5
0:0:NaN,0
-5:0:-inf,-5
-inf:0:-inf,-inf
# Numerator (dividend) is +/-inf, and denominator is finite and non-zero.
inf:-inf:NaN,NaN
inf:-5:-inf,NaN
inf:5:inf,NaN
inf:inf:NaN,NaN
-inf:-inf:NaN,NaN
-inf:-5:inf,NaN
-inf:5:-inf,NaN
-inf:inf:NaN,NaN
# Denominator (divisor) is +/-inf. The cases when the numerator is +/-inf
# are covered above.
-5:inf:0,-5
0:inf:0,0
5:inf:0,5
-5:-inf:0,-5
0:-inf:0,0
5:-inf:0,5
# Numerator is finite, and denominator is finite and non-zero.
-5:-5:1,0
-5:-2:2,-1
-5:-1:5,0
-5:1:-5,0
-5:2:-2,-1
-5:5:-1,0
-2:-5:0,-2
-2:-2:1,0
-2:-1:2,0
-2:1:-2,0
-2:2:-1,0
-2:5:0,-2
-1:-5:0,-1
-1:-2:0,-1
-1:-1:1,0
-1:1:-1,0
-1:2:0,-1
-1:5:0,-1
0:-5:0,0
0:-2:0,0
0:-1:0,0
0:1:0,0
0:2:0,0
0:5:0,0
1:-5:0,1
1:-2:0,1
1:-1:-1,0
1:1:1,0
1:2:0,1
1:5:0,1
2:-5:0,2
2:-2:-1,0
2:-1:-2,0
2:1:2,0
2:2:1,0
2:5:0,2
5:-5:-1,0