ó
    Š*£hj  ã                   óh   • S r SSKJrJrJrJrJr  SSKJ	r	  SSK
Jr  SSKJr  \ " S S\	5      5       rg)	z4Implementation of :class:`GMPYRationalField` class. é    )ÚGMPYRationalÚSymPyRationalÚ
gmpy_numerÚ
gmpy_denomÚ	factorial)ÚRationalField)ÚCoercionFailed)Úpublicc                   ó¶   • \ rS rSrSr\r\" S5      r\" S5      r\	" \5      r
SrS rS rS rS	 rS
 rS rS rS rS rS rS rS rS rS rS rS rS rSrg)ÚGMPYRationalFieldé   z©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                 ó   • g )N© )Úselfs    Úb/home/mande/repo/quber/.venv/lib/python3.13/site-packages/sympy/polys/domains/gmpyrationalfield.pyÚ__init__ÚGMPYRationalField.__init__   s   € Øó    c                 ó   • SSK Jn  U" 5       $ )z'Returns ring associated with ``self``. r   )ÚGMPYIntegerRing)Úsympy.polys.domainsr   )r   r   s     r   Úget_ringÚGMPYRationalField.get_ring   s   € å7ÙÓ Ð r   c                 ób   • [        [        [        U5      5      [        [        U5      5      5      $ )z!Convert ``a`` to a SymPy object. )r   Úintr   r   ©r   Úas     r   Úto_sympyÚGMPYRationalField.to_sympy"   s&   € äœS¤¨A£Ó/Ü ¤¨A£Ó/ó1ð 	1r   c                 óø   • UR                   (       a   [        UR                  UR                  5      $ UR                  (       a+  SSKJn  [        [        [        UR                  U5      5      6 $ [        SU-  5      e)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_sympyÚGMPYRationalField.from_sympy'   sT   € à�=�=Ü §¡ Q§S¡SÓ)Ð)Ø�Z�ZÝ.Ü¤¤S¨"¯.©.¸Ó*;Ó!<Ð=Ð=ä Ð!GÈ!Ñ!KÓLÐLr   c                 ó   • [        U5      $ )z.Convert a Python ``int`` object to ``dtype``. ©r   ©ÚK1r   ÚK0s      r   Úfrom_ZZ_pythonÚ GMPYRationalField.from_ZZ_python1   ó   € ä˜A‹Ðr   c                 óB   • [        UR                  UR                  5      $ )z3Convert a Python ``Fraction`` object to ``dtype``. )r   Ú	numeratorÚdenominatorr.   s      r   Úfrom_QQ_pythonÚ GMPYRationalField.from_QQ_python5   s   € ä˜AŸK™K¨¯©Ó7Ð7r   c                 ó   • [        U5      $ )z,Convert a GMPY ``mpz`` object to ``dtype``. r-   r.   s      r   Úfrom_ZZ_gmpyÚGMPYRationalField.from_ZZ_gmpy9   r3   r   c                 ó   • U$ )z,Convert a GMPY ``mpq`` object to ``dtype``. r   r.   s      r   Úfrom_QQ_gmpyÚGMPYRationalField.from_QQ_gmpy=   s   € àˆr   c                 óN   • UR                   S:X  a  [        UR                  5      $ g)z3Convert a ``GaussianElement`` object to ``dtype``. r   N)Úyr   Úxr.   s      r   Úfrom_GaussianRationalFieldÚ,GMPYRationalField.from_GaussianRationalFieldA   s!   € à�3‰3�!‹8Ü §¡Ó$Ð$ð r   c                 óL   • [        [        [        UR                  U5      5      6 $ )z.Convert a mpmath ``mpf`` object to ``dtype``. )r   r(   r   r)   r.   s      r   Úfrom_RealFieldÚ GMPYRationalField.from_RealFieldF   s   € äœS¤ b§n¡n°QÓ&7Ó8Ð9Ð9r   c                 ó0   • [        U5      [        U5      -  $ )z=Exact quotient of ``a`` and ``b``, implies ``__truediv__``.  r-   ©r   r   Úbs      r   ÚexquoÚGMPYRationalField.exquoJ   ó   € ä˜A‹¤¨a£Ñ0Ð0r   c                 ó0   • [        U5      [        U5      -  $ )z6Quotient of ``a`` and ``b``, implies ``__truediv__``. r-   rH   s      r   ÚquoÚGMPYRationalField.quoN   rL   r   c                 ó   • U R                   $ )z0Remainder of ``a`` and ``b``, implies nothing.  )ÚzerorH   s      r   ÚremÚGMPYRationalField.remR   s   € à�y‰yÐr   c                 óH   • [        U5      [        U5      -  U R                  4$ )z6Division of ``a`` and ``b``, implies ``__truediv__``. )r   rQ   rH   s      r   ÚdivÚGMPYRationalField.divV   s   € ä˜A‹¤¨a£Ñ0°$·)±)Ð;Ð;r   c                 ó   • UR                   $ )zReturns numerator of ``a``. )r5   r   s     r   ÚnumerÚGMPYRationalField.numerZ   s   € à�{‰{Ðr   c                 ó   • UR                   $ )zReturns denominator of ``a``. )r6   r   s     r   ÚdenomÚGMPYRationalField.denom^   s   € à�}‰}Ðr   c                 ó<   • [        [        [        U5      5      5      $ )zReturns factorial of ``a``. )r   Úgmpy_factorialr   r   s     r   r   ÚGMPYRationalField.factorialb   s   € äœN¬3¨q«6Ó2Ó3Ð3r   r   N)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r   ÚdtyperQ   ÚoneÚtypeÚtpÚaliasr   r   r    r*   r1   r7   r:   r=   rB   rE   rJ   rN   rR   rU   rX   r[   r   Ú__static_attributes__r   r   r   r   r      s„   † ñð €EÙ�‹8€DÙ
�‹(€CÙ	ˆc‹€BØ€Eòò!ò
1ò
Mòò8òòò%ò
:ò1ò1òò<òòõ4r   r   N)rd   Úsympy.polys.domains.groundtypesr   r   r   r   r   r^   Ú!sympy.polys.domains.rationalfieldr   Úsympy.polys.polyerrorsr	   Úsympy.utilitiesr
   r   r   r   r   Ú<module>ro      s9   ðÙ :÷õ õ <Ý 1Ý "àôW4˜ó W4ó ñW4r   