division: Algorithms for divisions

Description Usage Arguments Details Value See Also Examples

Description

Algorithms for division that provide a quotient and remainder.

Usage

1
2
3
naivediv(m, n)

longdiv(m, n)

Arguments

m

the dividend

n

the divisor

Details

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

Value

the quotient and remainder as a list

See Also

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

Examples

1
2
3
4
a <- floor(runif(1, 1, 1000))
b <- floor(runif(1, 1, 100))
naivediv(a, b)
longdiv(a, b)

cmna documentation built on July 14, 2021, 5:11 p.m.