Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
I found this function and it seemed reasonable, but some of my users reported that I was somtimes returning the wrong sign.
Turns out that the function above has inconsistent behavior on negative numbers:
when they should really both be 5. 14 years late, but here's a fix. I changed my code so that gcf() ends with return abs $x; In reply to Re: greatest common factor
by TheAmigo
|
|