Overview

The {gcd} package offers two functions:

  • gcd(): greatest common divisor of two numbers.
  • lcm(): least common multiple of two numbers.

Installation

You can install the development version of gcd from GitHub with:

# install.packages("devtools")
devtools::install_github("mayer79/gcd")

Usage

library(gcd)
#> 
#> Attaching package: 'gcd'
#> The following object is masked from 'package:graphics':
#> 
#>     lcm

a <- 123
b <- 10947

gcd(a, b)
#> [1] 123

lcm(a, b)
#> [1] 10947