Difference between revisions of "Template:Gcd/doc"

From blackwiki
Jump to navigation Jump to search
(+ja)
imported>Mr. Stradivarius
(update after switch to Module:Math)
Line 1: Line 1:
<noinclude>:''This is the documentation of [[Template:gcd]].''</noinclude>
+
{{documentation subpage}}
 +
{{lua|Module:Math}}
  
{{Intricate template}}
+
This template calculates the '''[[greatest common divisor]]''' (gcd) of two or more parameters.
 
 
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==
 
==Examples==
 
*<nowiki>{{gcd|16|6}}</nowiki>&nbsp;&rarr; {{gcd|16|6}}
 
*<nowiki>{{gcd|16|6}}</nowiki>&nbsp;&rarr; {{gcd|16|6}}
 +
*<nowiki>{{gcd|360|180|120|90}}</nowiki>&nbsp;&rarr; {{gcd|360|180|120|90}}
 
*<nowiki>{{gcd|544|119}}</nowiki>&nbsp;&rarr; {{gcd|544|119}}
 
*<nowiki>{{gcd|544|119}}</nowiki>&nbsp;&rarr; {{gcd|544|119}}
*<nowiki>{{gcd|2089|3571}}</nowiki>&nbsp;&rarr; {{gcd|2089|3571}} (algorithm iteration limit reached)
+
*<nowiki>{{gcd|2089|3571}}</nowiki>&nbsp;&rarr; {{gcd|2089|3571}}
  
 
<includeonly>
 
<includeonly>

Revision as of 14:42, 23 December 2013

This template calculates the greatest common divisor (gcd) of two or more parameters.

Examples

  • {{gcd|16|6}} → 2
  • {{gcd|360|180|120|90}} → 30
  • {{gcd|544|119}} → 17
  • {{gcd|2089|3571}} → 1