Skip to content

Commit

Permalink
Speedup by using native ints.
Browse files Browse the repository at this point in the history
Thanks to dogbert17 .
  • Loading branch information
shlomif committed Apr 30, 2017
1 parent b5fd7f5 commit 1fe0a75
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions categories/euler/prob601-shlomif.p6
Expand Up @@ -15,11 +15,11 @@ L<http://projecteuler.net/problem=601>

sub calc_P($s, $N)
{
my $l = [lcm] 1 .. $s;
my $i = 0;
my $ret = 0;
my $t = $s + 1;
my $M = $N - 1;
my int $l = [lcm] 1 .. $s;
my int $i = 0;
my int $ret = 0;
my int $t = $s + 1;
my int $M = $N - 1;
while (($i = $i + $l) < $M)
{
++$ret if $i % $t;
Expand Down

0 comments on commit 1fe0a75

Please sign in to comment.