Difference between revisions of "GCD Command"

From GeoGebra Manual
Jump to: navigation, search
m (Bot: Automated text replacement (-{{command +{{command|cas=true))
m
Line 3: Line 3:
 
{{Alternate Language|region=US|page_type=Command|US_version=GCD|non-US_version=HCF}}  
 
{{Alternate Language|region=US|page_type=Command|US_version=GCD|non-US_version=HCF}}  
  
;GCD[Number a, Number b]
+
;GCD[ <Number a>, <Number b> ]
 
:Calculates the greatest common divisor of numbers ''a'' and ''b''.
 
:Calculates the greatest common divisor of numbers ''a'' and ''b''.
 
:{{example| 1=<div><code><nowiki>GCD[12, 15]</nowiki></code> yields ''3''.</div>}}
 
:{{example| 1=<div><code><nowiki>GCD[12, 15]</nowiki></code> yields ''3''.</div>}}
;GCD[List of Numbers]
+
;GCD[ <List of Numbers> ]
 
:Calculates the greatest common divisor of the list of numbers.
 
:Calculates the greatest common divisor of the list of numbers.
 
:{{example| 1=<div><code><nowiki>GCD[{12, 30, 18}]</nowiki></code> yields ''6''.</div>}}
 
:{{example| 1=<div><code><nowiki>GCD[{12, 30, 18}]</nowiki></code> yields ''6''.</div>}}
 
==CAS Syntax==
 
==CAS Syntax==
;GCD[ <Number , Number> ]
+
;GCD[ <Number> , <Number> ]
 
:Calculates the greatest common divisor of the two numbers .
 
:Calculates the greatest common divisor of the two numbers .
 
:{{example| 1=<div><code><nowiki>GCD[12, 15]</nowiki></code> yields ''3''.</div>}}
 
:{{example| 1=<div><code><nowiki>GCD[12, 15]</nowiki></code> yields ''3''.</div>}}
Line 21: Line 21:
 
;GCD[ <List of Polynomials> ]
 
;GCD[ <List of Polynomials> ]
 
: Calculates the greatest common divisor of the list of polynomials.
 
: Calculates the greatest common divisor of the list of polynomials.
:{{example| 1=<div><code><nowiki>GCD[{x^2 + 4 x + 4, x^2 - x - 6, - 4x² - 3x + 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>}}

Revision as of 10:39, 14 September 2012



GCD[ <Number a>, <Number b> ]
Calculates the greatest common divisor of numbers a and b.
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.

CAS Syntax

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.
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.
© 2024 International GeoGebra Institute