Introduction

This online help node and the nodes below it describe the operators and functions for working with the ring of rational integers Z.

Integers are the most commonly used objects in Magma. They can be created by just typing in the literal (decimal) digits. Integers thus created are elements of the ring of integers which is automatically created when Magma is started up. There is just one single object `integer ring' around, but references to it (new `names' for it) can be created using the IntegerRing function.

Contents

Representation

Since large integers occur so frequently, the first requirement for a computer algebra system is to support fast arithmetic for integers of arbitrary size. Indeed, within the bounds set by the available memory, it is possible to operate reasonably efficiently with integers of any number of decimal digits.

Although it is well possible to use the integer facilities without being aware of the internal representation of (large) integers, it is sometimes useful to know how integers are stored. The most important fact is that integers smaller than 230=1073741824 in absolute value are `single precision', and in many circumstances such `small integers' allow considerably faster arithmetic (they are treated slightly differently internally and escape the overhead of memory management used to deal with multi-precision integers).

Coercion

Integers will be automatically coerced into almost every unitary ring R using the identification of 1 and 1R. This means that integer arguments are allowed for almost any ring element function, and that it is not necessary to convert an integer before applying binary operators (such as +) on a combination of arguments consisting of an integer and another ring element.

Homomorphisms

Ring homomorphisms are required to be unitary. Therefore, to specify a homomorphism with the integers as its domain requires merely the specification of the codomain.

hom< Z -> R | > : RngInt, Rng -> Map
The natural homomorphism from Z to the ring R.

Example RngInt_hom (H19E1)

> h := hom< Integers() -> MatrixRing(RealField(12), 3) | >;
> h(2)^-1;
[0.5   0   0]
[  0 0.5   0]
[  0   0 0.5]
V2.28, 13 July 2023