Ë
    7^(hj  ã                   óh   — d Z ddlmZmZmZmZmZ ddlm	Z	 ddl
mZ ddlmZ e G d„ de	«      «       Zy)	z4Implementation of :class:`GMPYRationalField` class. é    )ÚGMPYRationalÚSymPyRationalÚ
gmpy_numerÚ
gmpy_denomÚ	factorial)ÚRationalField)ÚCoercionFailed)Úpublicc                   ó®   — e Zd ZdZeZ ed«      Z ed«      Z ee«      Z	dZ
d„ Zd„ Zd„ Zd„ Zd	„ Zd
„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zy)ÚGMPYRationalFieldzµRational field based on GMPY's ``mpq`` type.

    This will be the implementation of :ref:`QQ` if ``gmpy`` or ``gmpy2`` is
    installed. Elements will be of type ``gmpy.mpq``.
    r   é   ÚQQ_gmpyc                  ó   — y )N© )Úselfs    úc/var/www/skyplay_api_hub/venv/lib/python3.12/site-packages/sympy/polys/domains/gmpyrationalfield.pyÚ__init__zGMPYRationalField.__init__   s   € Øó    c                 ó   — ddl m}  |«       S )z'Returns ring associated with ``self``. r   )ÚGMPYIntegerRing)Úsympy.polys.domainsr   )r   r   s     r   Úget_ringzGMPYRationalField.get_ring   s   € å7ÙÓ Ð r   c                 ób   — t        t        t        |«      «      t        t        |«      «      «      S )z!Convert ``a`` to a SymPy object. )r   Úintr   r   ©r   Úas     r   Úto_sympyzGMPYRationalField.to_sympy"   s&   € äœS¤¨A£Ó/Ü ¤¨A£Ó/ó1ð 	1r   c                 óä   — |j                   r t        |j                  |j                  «      S |j                  r+ddlm} t        t        t        |j                  |«      «      Ž S t        d|z  «      ‚)z&Convert SymPy's Integer to ``dtype``. r   )ÚRRz$expected ``Rational`` object, got %s)Úis_Rationalr   ÚpÚqÚis_Floatr   r   Úmapr   Úto_rationalr	   )r   r   r   s      r   Ú
from_sympyzGMPYRationalField.from_sympy'   sT   € à�=Š=Ü §¡ Q§S¡SÓ)Ð)Ø�ZŠZÝ.Ü¤¤S¨"¯.©.¸Ó*;Ó!<Ð=Ð=ä Ð!GÈ!Ñ!KÓLÐLr   c                 ó   — t        |«      S )z.Convert a Python ``int`` object to ``dtype``. ©r   ©ÚK1r   ÚK0s      r   Úfrom_ZZ_pythonz GMPYRationalField.from_ZZ_python1   ó   € ä˜A‹Ðr   c                 óB   — t        |j                  |j                  «      S )z3Convert a Python ``Fraction`` object to ``dtype``. )r   Ú	numeratorÚdenominatorr)   s      r   Úfrom_QQ_pythonz GMPYRationalField.from_QQ_python5   s   € ä˜AŸK™K¨¯©Ó7Ð7r   c                 ó   — t        |«      S )z,Convert a GMPY ``mpz`` object to ``dtype``. r(   r)   s      r   Úfrom_ZZ_gmpyzGMPYRationalField.from_ZZ_gmpy9   r-   r   c                 ó   — |S )z,Convert a GMPY ``mpq`` object to ``dtype``. r   r)   s      r   Úfrom_QQ_gmpyzGMPYRationalField.from_QQ_gmpy=   s   € àˆr   c                 óL   — |j                   dk(  rt        |j                  «      S y)z3Convert a ``GaussianElement`` object to ``dtype``. r   N)Úyr   Úxr)   s      r   Úfrom_GaussianRationalFieldz,GMPYRationalField.from_GaussianRationalFieldA   s!   € à�3‰3�!Š8Ü §¡Ó$Ð$ð r   c                 óL   — t        t        t        |j                  |«      «      Ž S )z.Convert a mpmath ``mpf`` object to ``dtype``. )r   r$   r   r%   r)   s      r   Úfrom_RealFieldz GMPYRationalField.from_RealFieldF   s   € äœS¤ b§n¡n°QÓ&7Ó8Ð9Ð9r   c                 ó0   — t        |«      t        |«      z  S )z=Exact quotient of ``a`` and ``b``, implies ``__truediv__``.  r(   ©r   r   Úbs      r   ÚexquozGMPYRationalField.exquoJ   ó   € ä˜A‹¤¨a£Ñ0Ð0r   c                 ó0   — t        |«      t        |«      z  S )z6Quotient of ``a`` and ``b``, implies ``__truediv__``. r(   r=   s      r   ÚquozGMPYRationalField.quoN   r@   r   c                 ó   — | j                   S )z0Remainder of ``a`` and ``b``, implies nothing.  )Úzeror=   s      r   ÚremzGMPYRationalField.remR   s   € à�y‰yÐr   c                 óH   — t        |«      t        |«      z  | j                  fS )z6Division of ``a`` and ``b``, implies ``__truediv__``. )r   rD   r=   s      r   ÚdivzGMPYRationalField.divV   s   € ä˜A‹¤¨a£Ñ0°$·)±)Ð;Ð;r   c                 ó   — |j                   S )zReturns numerator of ``a``. )r/   r   s     r   ÚnumerzGMPYRationalField.numerZ   s   € à�{‰{Ðr   c                 ó   — |j                   S )zReturns denominator of ``a``. )r0   r   s     r   ÚdenomzGMPYRationalField.denom^   s   € à�}‰}Ðr   c                 ó<   — t        t        t        |«      «      «      S )zReturns factorial of ``a``. )r   Úgmpy_factorialr   r   s     r   r   zGMPYRationalField.factorialb   s   € äœN¬3¨q«6Ó2Ó3Ð3r   N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   ÚdtyperD   ÚoneÚtypeÚtpÚaliasr   r   r   r&   r,   r1   r3   r5   r9   r;   r?   rB   rE   rG   rI   rK   r   r   r   r   r   r      s„   „ ñð €EÙ�‹8€DÙ
�‹(€CÙ	ˆc‹€BØ€Eòò!ò
1ò
Mòò8òòò%ò
:ò1ò1òò<òòó4r   r   N)rQ   Úsympy.polys.domains.groundtypesr   r   r   r   r   rM   Ú!sympy.polys.domains.rationalfieldr   Úsympy.polys.polyerrorsr	   Úsympy.utilitiesr
   r   r   r   r   ú<module>r[      s9   ðÙ :÷õ õ <Ý 1Ý "àôW4˜ó W4ó ñW4r   