Skip to content

Commit 1fe0a75

Browse files
committed
Speedup by using native ints.
Thanks to dogbert17 .
1 parent b5fd7f5 commit 1fe0a75

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

categories/euler/prob601-shlomif.p6

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ L<http://projecteuler.net/problem=601>
1515

1616
sub calc_P($s, $N)
1717
{
18-
my $l = [lcm] 1 .. $s;
19-
my $i = 0;
20-
my $ret = 0;
21-
my $t = $s + 1;
22-
my $M = $N - 1;
18+
my int $l = [lcm] 1 .. $s;
19+
my int $i = 0;
20+
my int $ret = 0;
21+
my int $t = $s + 1;
22+
my int $M = $N - 1;
2323
while (($i = $i + $l) < $M)
2424
{
2525
++$ret if $i % $t;

0 commit comments

Comments
 (0)