Difference between revisions of "GCD Command"
From GeoGebra Manual
(command syntax: changed [ ] into ( )) |
|||
Line 17: | Line 17: | ||
:{{example| 1=<div><code><nowiki>GCD({x^2 + 4 x + 4, x^2 - x - 6, x^3 - 4 x^2 - 3 x + 18})</nowiki></code> yields ''x + 2''.</div>}} | :{{example| 1=<div><code><nowiki>GCD({x^2 + 4 x + 4, x^2 - x - 6, x^3 - 4 x^2 - 3 x + 18})</nowiki></code> yields ''x + 2''.</div>}} | ||
− | {{note|See also [[LCM Command]].}} | + | {{note|See also [[LCM Command]] and [[ExtendedGCD Command]].}} |
Latest revision as of 09:34, 29 April 2023
This command differs among variants of English:
|
- GCD( <Number>, <Number> )
- Calculates the greatest common divisor of the two numbers .
- Example:
GCD(12, 15)
yields 3.
- GCD( <List of Numbers> )
- Calculates the greatest common divisor of the list of numbers.
- Example:
GCD({12, 30, 18})
yields 6.
Hint: In the CAS View you can also use the following syntax:
- GCD( <Polynomial>, <Polynomial> )
- Calculates the greatest common divisor of the two polynomials.
- Example:
GCD(x^2 + 4 x + 4, x^2 - x - 6)
yields x + 2.
- GCD( <List of Polynomials> )
- Calculates the greatest common divisor of the list of polynomials.
- Example:
GCD({x^2 + 4 x + 4, x^2 - x - 6, x^3 - 4 x^2 - 3 x + 18})
yields x + 2.
Note: See also LCM Command and ExtendedGCD Command.