Description Usage Arguments Details Value Note See Also Examples

Greatest common divisor and least common multiple

1 2 |

`a, b` |
vectors of integers. |

`extended` |
logical; if |

Computation based on the extended Euclidean algorithm.

If both `a`

and `b`

are vectors of the same length, the greatest
common divisor/lowest common multiple will be computed elementwise.
If one is a vektor, the other a scalar, the scalar will be replicated to
the same length.

A numeric (integer) value or vector of integers. Or a list of three vectors
named `c, d, g`

, g containing the greatest common divisors, such that

`g = c * a + d * b`

.

The following relation is always true:

`n * m = gcd(n, m) * lcm(n, m)`

1 2 3 4 |

pracma documentation built on Jan. 30, 2018, 3:01 a.m.

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.