gcd: GCD and LCM

View source: R/gcd.R

gcdR Documentation

GCD and LCM

Description

Useful math functions that R doesn't have.

Usage

gcd(a, b)

lcm(a, b)

Arguments

a,b

numbers to compute the greatest common divisor or least common multiple of.

Value

The greatest common divisor or least common multiple.

Examples

gcd(56, 42)
gcd(57, 42)
gcd(59, 42)

lcm(56, 42)
lcm(12, 42)

graywh/r-gmisc documentation built on April 19, 2023, 1:42 p.m.