 | 113172 | May 25, 2004 1:14pm | pjd: shouldn't gcd produce an error if one of the arguments is zero ? your python implementation would return the first argument as result, if the second argument is zero, which would be wrong.
My Forth implementation suffers from the same problem if the first argument is zero, and only throws "division by zero" if the second argument is zero.
Same goes for InertialMass's C-implementation: if u is 0, v is (incorrectly) returned, and, reviewing the Ruby implementation, it should exhibit the same problem. |
|