Learn R Programming

cmna (version 1.0.5)

division: Algorithms for divisions

Description

Algorithms for division that provide a quotient and remainder.

Usage

naivediv(m, n)

longdiv(m, n)

Arguments

m

the dividend

n

the divisor

Value

the quotient and remainder as a list

Details

The naivediv divides m by n by using repeated division. The longdiv function uses the long division algorithm in binary.

See Also

Other algebra: bilinear(), cubicspline(), fibonacci(), horner(), isPrime(), linterp(), nthroot(), polyinterp(), pwiselinterp(), quadratic()

Examples

Run this code
# NOT RUN {
a <- floor(runif(1, 1, 1000))
b <- floor(runif(1, 1, 100))
naivediv(a, b)
longdiv(a, b)

# }

Run the code above in your browser using DataLab