in reply to Euclid's Algorithm: A Homage to Tilly

sub gcd { my ($n, $m) = @_; ($n, $m) = ($m, $n % $m) while $m; return $n; }

Replies are listed 'Best First'.
Re: Re: Euclid's Algorithm: A Homage to Tilly
by Anonymous Monk on Sep 07, 2002 at 23:29 UTC
    Fewer moving parts.
    sub gcd { my ($n, $m) = @_; $m ? gcd($m, $n%$m) : $n; }
    But is worrying about this a false path?