Dom::IntegerMod -- residue
class rings modulo integers
IntroductionDom::IntegerMod(n) creates the residue
class ring of integers modulo n.
DomainDom::IntegerMod(n)
Parametersn |
- | positive integer greater than 1 |
Introduction creates
the residue class of Dom::IntegerMod(n)(a)a modulo n.
Creating
ElementsDom::IntegerMod(n)(a)
Parametersa |
- | any integer or a rational number whose denominator is
coprime to n |
Related
DomainsDom::Integer, Dom::GaloisField
the characteristic of the residue class ring, n
the unit element, 1 mod n
the zero element, 0 mod n
_divide(dom element1, dom element2)_divide._invert(dom element)_invert._mult(dom element...)_mult._negate(dom element)_negate._plus(dom element...)_plus._power(dom element, integer power)powerth power of an element.
The result is an element of the residue class ring._power._subtract(dom element1, dom element2)_subtract.order(dom element)element in the group
of multiplicative units.FAIL if
element is not a unit.TeX(dom element)element to a TeX-formatted
string.convert(Type::Rational
number)number and
the modulus n are not relatively prime.convert_to(dom element, DOM_DOMAIN domain)element into an element of the
given domain if possible (now DOM_INT and Dom::Integer).expr(dom element)element into an integer
number.expr.print(dom element)random()random.
Example
1We define the residue class ring Z7:
>> Z7:= Dom::IntegerMod(7)
Dom::IntegerMod(7)
Next, we create some elements:
>> a:= Z7(1); b:= Z7(2); c:= Z7(3)
1 mod 7
2 mod 7
3 mod 7
We may use infix notation for arithmetical operations since the operators have been overloaded:
>> a + b, a*b*c, 1/c, b/c/a/c
3 mod 7, 6 mod 7, 5 mod 7, 1 mod 7
a and b are squares while
c is not:
>> Z7::isSquare(a), Z7::isSquare(b), Z7::isSquare(c)
TRUE, TRUE, FALSE
Indeed, c is a generator of the group of
units:
>> Z7::order(a), Z7::order(b), Z7::order(c)
1, 3, 6
Super-DomainAx::normalRep
, Ax::canonicalRep, Ax::noZeroDivisors, Ax::closedUnitNormals,
Ax::canonicalUnitNormal,
Ax::efficientOperation("_invert"),
Ax::efficientOperation("_divide"),
Ax::efficientOperation("_mult")