Sponsored links: Algebra eBooks ### The Maxima on-line user's manual

Algebra Calculator

#### Search: #### Modulus

-- Option variable: modulus Default value: `false`

When `modulus` is a positive number <p>, operations on rational numbers (as returned by `rat` and related functions) are carried out modulo <p>, using the so-called "balanced" modulus system in which `<n> modulo <p>` is defined as an integer <k> in `[-(<p>-1)/2, ..., 0, ..., (<p>-1)/2]` when <p> is odd, or `[-(<p>/2 - 1), ..., 0, ...., <p>/2]` when <p> is even, such that `<a> <p> + <k>` equals <n> for some integer <a>. If <expr> is already in canonical rational expression (CRE) form when `modulus` is reset, then you may need to re-rat <expr>, e.g., `expr: rat (ratdisrep (expr))`, in order to get correct results.

Typically `modulus` is set to a prime number. If `modulus` is set to a positive non-prime integer, this setting is accepted, but a warning message is displayed. Maxima will allow zero or a negative integer to be assigned to `modulus`, although it is not clear if that has any useful consequences.

```(%o1)                                true
(%i2) ```

### Related Examples

x = 21 ^ 21;

modulus:43;

y = x;

Calculate

modulus : 5;

3*4;

Calculate

##### modulus-solve-subst

A:4*x+19*y+26=z;

B:52*x+27*y+10=z;

C:36*x+65*y+18=z;

Calculate

modulus:2;

eq1:3=(3-b)*a;

eq2:2=(1-b)*a;

Calculate

modulus : 5;

3*4;

Calculate

##### modulus

modulus: 114573516752...

(x *65537) = 1;

x;

Calculate

modulus:23;

2^22;

Calculate

modulus:7;

Rat(02274308);

Calculate

x = 21 ^ 21;

modulus:43;

x;

Calculate

##### modulus

modulus:17;

3^16;

Calculate 