in reply to greatest common factor
gcf(-5, 5) = 5 gcf(5, -5) = -5 [download]
14 years late, but here's a fix. I changed my code so that gcf() ends with
return abs $x;