Very elegantly done. BTW, there's a typo in the sub multigcf: gcd should be gcf! Otherwise, a very nice offering.
-zeno
sub multigcf { my $x = shift; $x = gcd($x, shift) while @_; #should be gcf! return $x; }
In reply to Re: greatest common factor
by zeno
in thread greatest common factor
by MrNobo1024
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |