Next: , Previous: , Up: Types of Numbers   [Contents][Index]


63.2.8 The Type ‘residue-class-ring

The type ‘residue-class-ring’ is a super-type for all possible residue class rings, which in turn are the worlds (actually the types) of residue classes. To progressively meet the actual need for infinitely many types, we instead gather them into this super-type. The underlying C-type is ‘resc_rng’.

Lisp objects can be tested for the type ‘residue-class-ring’ by the following predicate.

Function: residue-class-ring-p object

Return t if object is a residue class ring, nil otherwise.

The read syntax of ‘residue-class-ring’s is inspired by the traditional algebra, hence the lisp reader interprets Z/mZ as ‘residue-class-ring’ whenever m is a rational integer. We call m the modulus of the residue class ring.

Of course, there exists a constructor to derive a residue class ring from a given modulus:

Function: make-residue-class-ring modulus

Return a residue class ring of size modulus (>= 2).

Z/24Z
     ⇒ Z/24Z
(make-residue-class-ring 24)
     ⇒ Z/24Z

The converse is possible via the accessor function residue-class-modulus, too. See next section for a detailed description.