Talk:Greatest common divisor: Difference between revisions
Content added Content deleted
m (→errors in programs: removed comment of abs(0)=0; -- ~~~~) |
(→errors in programs: added sigline to previous statements, added comments about gcd(0,0). -- ~~~~) |
||
Line 2: | Line 2: | ||
A few programs would attempt to divide by zero if the 2nd argument is 0 (zero). |
A few programs would attempt to divide by zero if the 2nd argument is 0 (zero). |
||
<br> In that special case, the absolute value of the first argument should be returned. |
<br> In that special case, the absolute value of the first argument should be returned. -- [[User:Gerard Schildberger|Gerard Schildberger]] 15:39, 17 August 2012 (UTC) |
||
::unless it is 0 --[[User:Walterpachl|Walterpachl]] 12:40, 17 August 2012 (UTC) |
::unless it is 0 --[[User:Walterpachl|Walterpachl]] 12:40, 17 August 2012 (UTC) |
||
::: The special case of '''gcd(0,0)''' is usually defined to be '''0''', but some authors consider it to be '''undefined'''. When implementing the REXX version 1 example, the first definition (0) was chosen. So, for that case, '''|0| = 0'''. -- [[User:Gerard Schildberger|Gerard Schildberger]] 15:39, 17 August 2012 (UTC) |
|||
⚫ | |||
⚫ | |||
== REXX Version 1 == |
== REXX Version 1 == |