gcd_subtraction: Computes the Greatest Common Divisor of two integers using...

Description Usage Arguments Value Examples

Description

Computes the greatest common divisor using the original implementation of the algorithm by Euclid. In this version of the algorithm, the quotient q_k and remainder r_k is calculated by repeated division by subtraction. Therefore, in this implementation of the greatest common divisor algorithm, the modulo operation in the division implementation is replaced by division by repeated subtraction.

Usage

1

Arguments

a

First integer

b

Second integer

Value

The greatest common divisor

Examples

1
2

aschleg/numberr documentation built on May 14, 2019, 10:31 a.m.