Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
24464: ZZ is complete
Browse files Browse the repository at this point in the history
  • Loading branch information
videlec committed Jan 3, 2018
1 parent a178204 commit c0b49bb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
6 changes: 3 additions & 3 deletions src/doc/en/thematic_tutorials/coercion_and_categories.rst
Expand Up @@ -1300,22 +1300,22 @@ 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
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
Expand Down
7 changes: 3 additions & 4 deletions src/sage/rings/integer_ring.pyx
Expand Up @@ -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:
Expand All @@ -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)
Expand Down

0 comments on commit c0b49bb

Please sign in to comment.