Skip to contents

Greatest Common Divisor (GCD) and Least Common Multiple (LCM)

Usage

GCD(x, y)

LCM(x, y)

Arguments

x

A single integer

y

A single integer

Value

The greatest common divisor of x and y

Examples

GCD(12, 18)
#> [1] 6
GCD(12, 0)
#> [1] 12
GCD(13, 2)
#> [1] 1
LCM(12, 18)
#> [1] 36
LCM(2, 6)
#> [1] 6
LCM(3, 5)
#> [1] 15