euclidean: euclidean function

Description Usage Arguments Value Examples

Description

This function implements the Euclidian algorithm to find the greatest common divisor of two numbers. The description of the algorithm with pseudocode can be found here: https://en.wikipedia.org/wiki/Euclidean_algorithm

Usage

1
euclidean(a, b)

Arguments

a

An integer.

b

An integer.

Value

This function return a number that shows the greatest common divisor of a and b.

Examples

1
2
euclidean(123612, 13892347912) #4
euclidean(100, 1000) #100

nahfa911/rlab03 documentation built on May 9, 2019, 5:55 a.m.