modulus: Modulus of integers

Description Usage Arguments Details Note Author(s) See Also Examples

Description

Getting and setting the working modulus for clock arithmetic

Usage

1

Arguments

n

Non-negative integer, >1

Details

The sine qua non for modular arithmetic is having a modulus to work to. The first thing to do is to set the modulus with function modulus(). The typical work-flow for the package is to define a modulus and work in this modulus for an extended period of time. It is not expected that users will change the working modulus very frequently. Indeed, doing so may result in interwoven alignment preambles are not allowed errors.

The package can deal with a non-prime modulus but then division is not defined.

The function and workflow are based on the sol() function of the lorentz package.

Note

Typing “modulus(5)” is a lot easier than typing “options("M"=5)”, which is why the package uses the idiom that it does.

Author(s)

Robin K. S. Hankin

See Also

clock

Examples

1
2
modulus(7)
table(as.mod(1:1000) == 4)

RobinHankin/clock documentation built on Nov. 8, 2021, 6:17 p.m.