aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordrbaggy <js5@sanger.ac.uk>2022-01-04 09:16:29 +0000
committerdrbaggy <js5@sanger.ac.uk>2022-01-04 09:16:29 +0000
commit49715bb9e617d9cf5c1b8895087e46a3331d4927 (patch)
tree27f481a5e807eeb620375d91419b3c56c3d58b36
parent68ca0aa828d69d9e7aaf229153f0ca31c180af9a (diff)
downloadperlweeklychallenge-club-49715bb9e617d9cf5c1b8895087e46a3331d4927.tar.gz
perlweeklychallenge-club-49715bb9e617d9cf5c1b8895087e46a3331d4927.tar.bz2
perlweeklychallenge-club-49715bb9e617d9cf5c1b8895087e46a3331d4927.zip
sqrt -> square
-rw-r--r--challenge-146/james-smith/README.md2
-rw-r--r--challenge-146/james-smith/perl/ch-1.pl2
2 files changed, 2 insertions, 2 deletions
diff --git a/challenge-146/james-smith/README.md b/challenge-146/james-smith/README.md
index 9574f3753d..b25034a695 100644
--- a/challenge-146/james-smith/README.md
+++ b/challenge-146/james-smith/README.md
@@ -26,7 +26,7 @@ We could use a Prime module, but finding primes is not that difficult so we will
my @primes = (3);
for( my $c=5; @primes<10000; $c+=2 ) {
- ($_>sqrt$c)?((push@primes,$c),last):$c%$_||last for @primes;
+ ($_*$_>$c)?((push@primes,$c),last):$c%$_||last for @primes;
}
say $primes[-1];
diff --git a/challenge-146/james-smith/perl/ch-1.pl b/challenge-146/james-smith/perl/ch-1.pl
index fe3c61704e..692ac8d92d 100644
--- a/challenge-146/james-smith/perl/ch-1.pl
+++ b/challenge-146/james-smith/perl/ch-1.pl
@@ -8,7 +8,7 @@ use feature qw(say);
my @primes = (2);
for( my $c=3; @primes<10001; $c+=2 ) {
- ($_>sqrt$c)?((push@primes,$c),last):$c%$_||last for @primes;
+ ($_*$_>$c)?((push@primes,$c),last):$c%$_||last for @primes;
}
say $primes[-1];