From c0b49bb8016703be8e530686c0acae4b78412a86 Mon Sep 17 00:00:00 2001 From: Vincent Delecroix <20100.delecroix@gmail.com> Date: Wed, 3 Jan 2018 17:06:56 +0100 Subject: [PATCH] 24464: ZZ is complete --- src/doc/en/thematic_tutorials/coercion_and_categories.rst | 6 +++--- src/sage/rings/integer_ring.pyx | 7 +++---- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/doc/en/thematic_tutorials/coercion_and_categories.rst b/src/doc/en/thematic_tutorials/coercion_and_categories.rst index e1e1872a5fe..a01f1acee33 100644 --- a/src/doc/en/thematic_tutorials/coercion_and_categories.rst +++ b/src/doc/en/thematic_tutorials/coercion_and_categories.rst @@ -1300,7 +1300,7 @@ When we apply ``Compl``, ``Matr`` and ``Poly`` to the ring of integers, we obtain:: sage: (Poly*Matr*Compl)(ZZ) - Univariate Polynomial Ring in x over Full MatrixSpace of 3 by 3 dense matrices over Real Field with 53 bits of precision + Univariate Polynomial Ring in x over Full MatrixSpace of 3 by 3 dense matrices over Integer Ring .. end of output @@ -1308,14 +1308,14 @@ Applying the shuffling procedure yields :: sage: (Poly*Matr*Fract*Poly*AlgClos*Fract*Compl)(ZZ) - Univariate Polynomial Ring in x over Full MatrixSpace of 3 by 3 dense matrices over Fraction Field of Univariate Polynomial Ring in x over Complex Field with 53 bits of precision + Univariate Polynomial Ring in x over Full MatrixSpace of 3 by 3 dense matrices over Fraction Field of Univariate Polynomial Ring in x over Algebraic Field .. end of output and this is indeed equal to the pushout found by Sage:: sage: pushout((Fract*Poly*AlgClos*Fract)(ZZ), (Poly*Matr*Compl)(ZZ)) - Univariate Polynomial Ring in x over Full MatrixSpace of 3 by 3 dense matrices over Fraction Field of Univariate Polynomial Ring in x over Complex Field with 53 bits of precision + Univariate Polynomial Ring in x over Full MatrixSpace of 3 by 3 dense matrices over Fraction Field of Univariate Polynomial Ring in x over Algebraic Field .. end of output diff --git a/src/sage/rings/integer_ring.pyx b/src/sage/rings/integer_ring.pyx index 3425989aac6..6fcb4f77cb1 100644 --- a/src/sage/rings/integer_ring.pyx +++ b/src/sage/rings/integer_ring.pyx @@ -1106,7 +1106,7 @@ cdef class IntegerRing_class(PrincipalIdealDomain): def completion(self, p, prec, extras = {}): r""" - Return the completion of the integers at the prime `p`. + Return the metric completion of the integers at the prime `p`. INPUT: @@ -1124,13 +1124,12 @@ cdef class IntegerRing_class(PrincipalIdealDomain): EXAMPLES:: sage: ZZ.completion(infinity, 53) - Real Field with 53 bits of precision + Integer Ring sage: ZZ.completion(5, 15, {'print_mode': 'bars'}) 5-adic Ring with capped relative precision 15 """ if p == sage.rings.infinity.Infinity: - from sage.rings.real_mpfr import create_RealField - return create_RealField(prec, **extras) + return self else: from sage.rings.padics.factory import Zp return Zp(p, prec, **extras)