Difference between revisions of "Manuals/calci/GCD"
Jump to navigation
Jump to search
(10 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
− | =GCD( | + | <div style="font-size:30px">'''GCD()'''</div><br/> |
+ | *Parameters are any set of integer values. | ||
+ | **GCD(),calculates the 'Greatest Common Divisor' of two or more integers. | ||
− | + | == Description == | |
+ | |||
+ | GCD() | ||
− | + | For Example, | |
− | + | GCD(25,100) ''returns 25'' | |
− | + | The divisors for '25' are 1,5,5. | |
− | + | The divisors for '100' are 1,2,2,5,5. | |
− | GCD( | + | So, common divisors are 1,5,5. Hence the GCD(25,100) is '25'. |
*GCD value is the largest interger that divides the input numbers without a remainder. | *GCD value is the largest interger that divides the input numbers without a remainder. | ||
*If any 'number' is nonnumeric, Calci displays an #ERROR message. | *If any 'number' is nonnumeric, Calci displays an #ERROR message. | ||
*If any 'number' is negative, Calci displays an #ERROR message. | *If any 'number' is negative, Calci displays an #ERROR message. | ||
+ | *For only one 'number' is entered, Calci assumes the second number to be '0'. | ||
+ | *If any 'number' is not an integer, it is truncated. | ||
== Examples == | == Examples == | ||
Line 27: | Line 33: | ||
|- class="odd" | |- class="odd" | ||
− | |class="sshl_f" |GCD() | + | |class="sshl_f" |GCD(48,64) |
− | |class="sshl_f" | | + | |class="sshl_f" |16 |
|- class="even" | |- class="even" | ||
− | |class="sshl_f" |GCD() | + | |class="sshl_f" |GCD(125,0) |
− | |class="sshl_f" | | + | |class="sshl_f" |125 |
|- class="odd" | |- class="odd" | ||
− | |class="sshl_f" |GCD() | + | |class="sshl_f" |GCD(125,5) |
− | |class="sshl_f" | | + | |class="sshl_f" |5 |
|- class="even" | |- class="even" | ||
− | |class="sshl_f" |GCD() | + | |class="sshl_f" |GCD(125,5.5) |
− | |class="sshl_f" | | + | |class="sshl_f" |5 |
|- class="odd" | |- class="odd" | ||
− | |class="sshl_f" |GCD() | + | |class="sshl_f" |GCD(0.8,2) |
− | |class="sshl_f" | | + | |class="sshl_f" |2 |
|} | |} | ||
+ | |||
+ | ==Related Videos== | ||
+ | |||
+ | {{#ev:youtube|jFd-6EPfnec|280|center|GCD}} | ||
+ | |||
+ | == See Also == | ||
+ | |||
+ | *[[Manuals/calci/LCM | LCM]] | ||
+ | |||
+ | ==References== | ||
+ | |||
+ | *[http://en.wikipedia.org/wiki/Greatest_common_divisor Greatest Common Divisor] | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | *[[Z_API_Functions | List of Main Z Functions]] | ||
+ | |||
+ | *[[ Z3 | Z3 home ]] |
Latest revision as of 16:23, 17 August 2018
GCD()
- Parameters are any set of integer values.
- GCD(),calculates the 'Greatest Common Divisor' of two or more integers.
Description
GCD()
For Example,
GCD(25,100) returns 25
The divisors for '25' are 1,5,5.
The divisors for '100' are 1,2,2,5,5.
So, common divisors are 1,5,5. Hence the GCD(25,100) is '25'.
- GCD value is the largest interger that divides the input numbers without a remainder.
- If any 'number' is nonnumeric, Calci displays an #ERROR message.
- If any 'number' is negative, Calci displays an #ERROR message.
- For only one 'number' is entered, Calci assumes the second number to be '0'.
- If any 'number' is not an integer, it is truncated.
Examples
Function | GCD Output |
GCD(48,64) | 16 |
GCD(125,0) | 125 |
GCD(125,5) | 5 |
GCD(125,5.5) | 5 |
GCD(0.8,2) | 2 |
Related Videos
See Also
References