Skip to content

Commit

Permalink
Add .expmod with negative power tests
Browse files Browse the repository at this point in the history
  • Loading branch information
zoffixznet committed Oct 9, 2017
1 parent 48d5d39 commit 064707a
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions S32-num/expmod.t
@@ -1,6 +1,6 @@
use v6;
use Test;
plan 117;
plan 118;

# L<S32::Numeric/Numeric/"=item expmod">

Expand All @@ -20,4 +20,14 @@ for 2..30 -> $i {
is 2988348162058574136915891421498819466320163312926952423791023078876139.expmod(
2351399303373464486466122544523690094744975233415544072992656881240319,
10 ** 40),
1527229998585248450016808958343740453059, "Rosettacode example is correct";
1527229998585248450016808958343740453059, "Rosettacode example is correct";

# RT #130713
subtest '.expmod with negative powers does not hang' => {
plan 3;
is-deeply 42.expmod(-1,1), 0, '-1, 1';
is-deeply 42.expmod(-42,42), 0, '-42, 42';

#?rakudo skip 'hangs RT#130713'
is-deeply 42.expmod(-1,7), 0, '-1. 7';
}

0 comments on commit 064707a

Please sign in to comment.