gcd(m,n)

Calculates greatest common divisor of two integers with Euclid's algorithm.

You are now following this Submission

GCD calculates the greatest common divisor of two integers, m and n, using Euclid's algorithm. Euclid's algorithm states that the gcd of m and n is the same as the gcd of n and mod(m,n).

Cite As

Andrew Wheatley (2026). gcd(m,n) (https://www.mathworks.com/matlabcentral/fileexchange/52223-gcd-m-n), MATLAB Central File Exchange. Retrieved .

General Information

MATLAB Release Compatibility

  • Compatible with any release

Platform Compatibility

  • Windows
  • macOS
  • Linux
Version Published Release Notes Action
1.0.0.0

Fixed description.