B
    ˜‘[¬  ã               @   sh   d Z ddlmZmZ ddlmZ ddlmZ ddlm	Z	 ddl
mZ ddlZeG dd	„ d	ee	eƒƒZdS )
z.Implementation of :class:`IntegerRing` class. é    )Úprint_functionÚdivision)ÚRing)ÚSimpleDomain)ÚCharacteristicZero)ÚpublicNc               @   sL   e Zd ZdZdZd ZZdZdZdZ	dZ
dd„ Zdd„ Zdd	„ Zd
d„ ZdS )ÚIntegerRingz!General class for integer rings. ZZZTc             C   s   ddl m} |S )z*Returns a field associated with ``self``. r   )ÚQQ)Zsympy.polys.domainsr	   )Úselfr	   © r   ú>lib/python3.7/site-packages/sympy/polys/domains/integerring.pyÚ	get_field   s    zIntegerRing.get_fieldc             G   s   |   ¡ j|Ž S )z?Returns an algebraic field, i.e. `\mathbb{Q}(\alpha, \ldots)`. )r   Úalgebraic_field)r
   Ú	extensionr   r   r   r      s    zIntegerRing.algebraic_fieldc             C   s   |j r|  | ¡ |j¡S dS )z'Convert a ``ANP`` object to ``dtype``. N)Z	is_groundZconvertZLCZdom)ZK1ÚaZK0r   r   r   Úfrom_AlgebraicField#   s    zIntegerRing.from_AlgebraicFieldc             C   s   |   t t|ƒ|¡¡S )z#Returns b-base logarithm of ``a``. )ZdtypeÚmathÚlogÚint)r
   r   Úbr   r   r   r   (   s    zIntegerRing.logN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__ZrepZis_IntegerRingZis_ZZZis_NumericalZis_PIDZhas_assoc_RingZhas_assoc_Fieldr   r   r   r   r   r   r   r   r      s   r   )r   Z
__future__r   r   Zsympy.polys.domains.ringr   Z sympy.polys.domains.simpledomainr   Z&sympy.polys.domains.characteristiczeror   Zsympy.utilitiesr   r   r   r   r   r   r   Ú<module>   s   