Created
June 27, 2017 19:22
-
-
Save ronaldxs/74b7450aeccb48985fdede871f53d364 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Perl 6 version that runs faster than Perl 5 equivalent | |
my int ($a, $one, $three, $limit) = (42, 1, 3, 10000000); | |
loop (my int $i = 0; $i < $limit; $i++) { | |
$a += $one + $a%$three | |
} | |
say $a | |
# Perl 5 equivalent | |
my $a = 42; | |
for (my $i = 0; $i < 10000000; $i++) { | |
$a += 1 + $a%3 | |
} | |
print $a, "\n"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment