The ring of integers is automatically created when Magma is first loaded.
The ring may be formally created (and assigned to a variable)
using the function IntegerRing(). Subrings of Z will always
de ideals; see the section on ideals for details.
IntegerRing() : Null -> RngInt
Create the ring of integers Z. Analogous to the creation of the ring of integers of any number field, there is a version of IntegerRing that creates Z as the ring of integers of Q.
Since the ring of integers is around when Magma is started up, literally typed integers will be regarded as elements of the ring of integers.
Given a succession of decimal digits a_1, ..., a_r, create the corresponding integer. Leading zeros will be ignored.
Given a succession of decimal digits a_1, ..., a_r, create the corresponding integer as an element of Z.
Coerce the ring element a into the ring of integers Z; here a is allowed to be a an element of the ring of integers modulo m (in which case the result r satisfies 0 <= r < m), or an element of a finite field (in which case the result r satisfies 0 <= r < p if a is in the prime field, of characteristic p, and an error otherwise), or an element of the integers, rationals, a quadratic field, a cyclotomic field or a number field (in which cases the result is the obvious integer if a is integral and an error otherwise).
> Z := IntegerRing(); > n := 1234567890; > n in Z; true > m := elt< Z | 1234567890 >; > m eq n; true > l := Z ! elt< QuadraticField(3) | 1234567890, 0>; > l; 1234567890
Given a sequence of two-element tuples s=[ <p_1, k_1>, ..., <p_r, k_r> ] containing pairs of integers <p_i, k_i>, 1 <= i <= r, with k_i non-negative, this function returns the integer p_1^(k_1) ... p_r^(k_r). It is normally used for converting a factorization sequence to the corresponding integer.
Given a non-negative integer n and a positive integer b >= 2, return the unique base b representation of n in the form of a sequence Q. That is, if n = a_0b^0 + a_1b^1 + ... + a_(k - 1)b^(k - 1) with 0 <= a_i<b and a_(k - 1)> 0, then Q = [ a_0, a_1, ..., a_(k - 1) ]. (If n=0, then Q=[ ].)
Given a positive integer b >= 2 and a sequence Q = [ a_0, ..., a_(k - 1) ] of non-negative integers such that 0 <= a_i < b, return the integer n = a_0b^0 + a_1b^1 + ... + a_(k - 1)b^(k - 1). (If Q is the empty sequence, zero is returned.) This is the inverse operation of the base b representation.
Create the string consisting of the decimal digits of the integer n (preceded by the minus sign if n is negative).[Next] [Prev] [Right] [Left] [Up] [Index] [Root]