Welcome to the Monastery | |
PerlMonks |
Re: optimizing the miller-rabin algorithmby GrandFather (Saint) |
on May 16, 2006 at 01:46 UTC ( [id://549645]=note: print w/replies, xml ) | Need Help?? |
I'm not sure I can help with your question. But you do say you are doing this in part to learn Perl, so I'll make a few (kindly meant) comments about your code. First, always add use strict; use warnings; to your code. They will save you much grief and tearing of hair Avoid C style for loops. For example replace for (my $n=91001; $n<93000; $n++)with: for my $n (91001..93000)Do not use $a and $b as general purpose variables. They are magical and are used in the context of sort. DWIM is Perl's answer to Gödel
In Section
Seekers of Perl Wisdom
|
|