gcd: Greatest Common Divisor for vli Objects

Description Usage Arguments Value Author(s) Examples

View source: R/gcd.R

Description

gcd computes and returns the greatest common divisor of two vli (Very Large Integers) objects.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
gcd(x, y)

## Default S3 method:
gcd(x, y)

## S3 method for class 'numeric'
gcd(x, y)

## S3 method for class 'vli'
gcd(x, y)

Arguments

x

object of class vli or 32 bits integer

y

object of class vli or 32 bits integer

Value

object of class vli

Author(s)

Javier Leiva Cuadrado

Examples

1
2
3
x <- as.vli("1225312091263347514461245")
y <- as.vli("357590484262521")
gcd(x, y)

Example output

Very Large Integer: 
[1] 1

VeryLargeIntegers documentation built on March 26, 2020, 5:48 p.m.