philiprbrenan has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl use warnings FATAL => qw(all); use strict; use Data::Dump qw(dump); use bigint; say STDERR "AAAA ", (1 % 0); # Should fail say STDERR "BBBB ", dump(1 % 0); if (1) {use Math::BigInt; my $a = Math::BigInt::new(1); my $b = Math::BigInt::new(0); my $c = $a->bmod($b); say STDERR "CCCC ", dump($c); } # AAAA 1 # BBBB bless({ _a => undef, _p => undef, sign => "+", value => [1] }, +"Math::BigInt") # CCCC bless({ sign => NaN, value => [0] }, "Math::BigInt")
I think line AAAA should complain or return undef, not 1 to be consistent with the results at BBBB and CCCC. If this is not consistent, then please tell me where can I report this as a problem?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Test modulus zero in bigint
by philiprbrenan (Monk) on Sep 11, 2016 at 23:15 UTC | |
by Anonymous Monk on Sep 12, 2016 at 00:51 UTC | |
by Anonymous Monk on Sep 12, 2016 at 01:17 UTC |