+
    i                     ~    R t ^ RIHtHtHtHtHtHtH	t
 ^ RIHt ^ RIHt ^ RIHt ^ RIHt ] ! R R]4      4       tR# )	z2Implementation of :class:`GMPYIntegerRing` class. )GMPYIntegerSymPyInteger	factorial
gmpy_gcdexgmpy_gcdgmpy_lcmsqrt)
int_valued)IntegerRing)CoercionFailed)publicc                      a  ] tR t^t o Rt]t]! ^ 4      t]! ^4      t]	! ]4      t
RtR tR tR tR tR tR tR	 tR
 tR tR tR tR tR tR tR tR tR tRtV tR# )GMPYIntegerRingzInteger ring based on GMPY's ``mpz`` type.

This will be the implementation of :ref:`ZZ` if ``gmpy`` or ``gmpy2`` is
installed. Elements will be of type ``gmpy.mpz``.
ZZ_gmpyc                    R# )z$Allow instantiation of this domain. N )selfs   &ڃ/Users/tonyclaw/.openclaw/workspace/skills/math-calculator/venv/lib/python3.14/site-packages/sympy/polys/domains/gmpyintegerring.py__init__GMPYIntegerRing.__init__   s        c                *    \        \        V4      4      # )z!Convert ``a`` to a SymPy object. )r   intr   as   &&r   to_sympyGMPYIntegerRing.to_sympy   s    CF##r   c                    VP                   '       d   \        VP                  4      # \        V4      '       d   \        \	        V4      4      # \        RV,          4      h)z&Convert SymPy's Integer to ``dtype``. zexpected an integer, got %s)
is_Integerr   pr	   r   r   r   s   &&r   
from_sympyGMPYIntegerRing.from_sympy#   sC    <<<qss##]]s1v&& !>!BCCr   c                $    VP                  V4      # )z3Convert ``ModularInteger(int)`` to GMPY's ``mpz``. to_intK1r   K0s   &&&r   from_FF_pythonGMPYIntegerRing.from_FF_python,       yy|r   c                    \        V4      # )z,Convert Python's ``int`` to GMPY's ``mpz``. )r   r%   s   &&&r   from_ZZ_pythonGMPYIntegerRing.from_ZZ_python0   s    1~r   c                R    VP                   ^8X  d   \        VP                  4      # R# z1Convert Python's ``Fraction`` to GMPY's ``mpz``. Ndenominatorr   	numeratorr%   s   &&&r   from_QQGMPYIntegerRing.from_QQ4   "    ==Aq{{++ r   c                R    VP                   ^8X  d   \        VP                  4      # R# r/   r0   r%   s   &&&r   from_QQ_pythonGMPYIntegerRing.from_QQ_python9   r5   r   c                $    VP                  V4      # )z3Convert ``ModularInteger(mpz)`` to GMPY's ``mpz``. r#   r%   s   &&&r   from_FF_gmpyGMPYIntegerRing.from_FF_gmpy>   r*   r   c                    V# )z*Convert GMPY's ``mpz`` to GMPY's ``mpz``. r   r%   s   &&&r   from_ZZ_gmpyGMPYIntegerRing.from_ZZ_gmpyB   s    r   c                @    VP                   ^8X  d   VP                  # R# )z(Convert GMPY ``mpq`` to GMPY's ``mpz``. N)r1   r2   r%   s   &&&r   from_QQ_gmpyGMPYIntegerRing.from_QQ_gmpyF   s    ==A;; r   c                P    VP                  V4      w  r4V^8X  d   \        V4      # R# )z,Convert mpmath's ``mpf`` to GMPY's ``mpz``. N)to_rationalr   )r&   r   r'   r   qs   &&&  r   from_RealFieldGMPYIntegerRing.from_RealFieldK   s(    ~~a 6q>! r   c                @    VP                   ^ 8X  d   VP                  # R# )    N)yxr%   s   &&&r   from_GaussianIntegerRing(GMPYIntegerRing.from_GaussianIntegerRingR   s    33!833J r   c                &    \        W4      w  r4pWEV3# )z)Compute extended GCD of ``a`` and ``b``. )r   )r   r   bhsts   &&&   r   gcdexGMPYIntegerRing.gcdexV   s    Q"aQwr   c                    \        W4      # )z Compute GCD of ``a`` and ``b``. )r   r   r   rN   s   &&&r   gcdGMPYIntegerRing.gcd[       ~r   c                    \        W4      # )z Compute LCM of ``a`` and ``b``. )r   rU   s   &&&r   lcmGMPYIntegerRing.lcm_   rX   r   c                    \        V4      # )zCompute square root of ``a``. )	gmpy_sqrtr   s   &&r   r   GMPYIntegerRing.sqrtc   s    |r   c                    \        V4      # )zCompute factorial of ``a``. )gmpy_factorialr   s   &&r   r   GMPYIntegerRing.factorialg   s    a  r   r   N)__name__
__module____qualname____firstlineno____doc__r   dtypezeroonetypetpaliasr   r   r    r(   r,   r3   r7   r:   r=   r@   rE   rK   rR   rV   rZ   r   r   __static_attributes____classdictcell__)__classdict__s   @r   r   r      s      E8D
(C	cBE3$D,
,

"
! !r   r   N)rf   sympy.polys.domains.groundtypesr   r   r   r`   r   r   r   r   r]   sympy.core.numbersr	   sympy.polys.domains.integerringr
   sympy.polys.polyerrorsr   sympy.utilitiesr   r   r   r   r   <module>ru      sA    8  
 * 7 1 "Z!k Z! Z!r   