Template:Gcd
Jump to navigation
Jump to search
[edit] [ ] Template documentation
This template employs intricate features of template syntax. You are encouraged to familiarise yourself with its setup and parser functions before editing the template. If your edit causes unexpected problems, please undo it quickly, as this template may appear on a large number of pages. Remember that you can conduct experiments, and should test all improvements, in either the general Template sandbox or your user space before changing anything here. |
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)
The above documentation is transcluded from Template:Gcd/doc. (edit | history) Editors can experiment in this template's sandbox (create) and testcases (create) pages. Please add categories and interwikis to the /doc subpage. Subpages of this template. |