Greatest common divisor: Difference between revisions
Content deleted Content added
Added Haskell example |
|||
Line 131: | Line 131: | ||
===Iterative Euclid algorithm=== |
===Iterative Euclid algorithm=== |
||
subroutine gcd_iter(value, u, v) |
subroutine gcd_iter(value, u, v) |
||
Cf2py integer intent(out) :: value |
Cf2py integer, intent(out) :: value |
||
integer value, u, v, t |
integer value, u, v, t |
||
intrinsic abs, mod |
intrinsic abs, mod |
||
Line 145: | Line 145: | ||
===Iterative binary algorithm=== |
===Iterative binary algorithm=== |
||
subroutine gcd_bin(value, u, v) |
subroutine gcd_bin(value, u, v) |
||
Cf2py integer intent(out) :: value |
Cf2py integer, intent(out) :: value |
||
integer value, u, v, k, t, abs, mod |
integer value, u, v, k, t, abs, mod |
||
intrinsic abs, mod |
intrinsic abs, mod |