Difference between revisions of "Template:Gcd"

From MidsouthMakers - Memphis Area Hackerpace
Jump to navigation Jump to search
m (1 revision)
 
(No difference)

Latest revision as of 17:53, 18 January 2010

[edit] [purge] Template documentation

This template calculates the greatest common divisor (gcd) of two parameters. It returns the value of gcd. Zero is returned when calculation is too complex (this implementation only allows for ten iterations of the Euclidean algorithm).

Examples

  • {{gcd|16|6}} → 2
  • {{gcd|544|119}} → 17
  • {{gcd|2089|3571}} → 0 (algorithm iteration limit reached)

ja:Template:Gcd