+
    i                     ~    R t ^ RIH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 R]4      4       tR# )	z4Implementation of :class:`PythonIntegerRing` class. )
int_valued)PythonIntegerSymPyIntegersqrt	factorialpython_gcdex
python_gcd
python_lcm)IntegerRing)CoercionFailed)publicc                      a  ] tR t^t o Rt]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V tR# )PythonIntegerRingzInteger ring based on Python's ``int`` type.

This will be used as :ref:`ZZ` if ``gmpy`` and ``gmpy2`` are not
installed. Elements are instances of the standard Python ``int`` type.
	ZZ_pythonc                    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/pythonintegerring.py__init__PythonIntegerRing.__init__   s        c                    \        V4      # )z!Convert ``a`` to a SymPy object. )r   r   as   &&r   to_sympyPythonIntegerRing.to_sympy   s    A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   intr   r   s   &&r   
from_sympyPythonIntegerRing.from_sympy!   sC    <<< %%]] Q(( !>!BCCr   c                $    VP                  V4      # )z5Convert ``ModularInteger(int)`` to Python's ``int``. )to_intK1r   K0s   &&&r   from_FF_python PythonIntegerRing.from_FF_python*   s    yy|r   c                    V# )z.Convert Python's ``int`` to Python's ``int``. r   r$   s   &&&r   from_ZZ_python PythonIntegerRing.from_ZZ_python.   s    r   c                @    VP                   ^8X  d   VP                  # R# z3Convert Python's ``Fraction`` to Python's ``int``. Ndenominator	numeratorr$   s   &&&r   from_QQPythonIntegerRing.from_QQ2       ==A;; r   c                @    VP                   ^8X  d   VP                  # R# r-   r.   r$   s   &&&r   from_QQ_python PythonIntegerRing.from_QQ_python7   r3   r   c                6    \        VP                  V4      4      # )z5Convert ``ModularInteger(mpz)`` to Python's ``int``. )r   r#   r$   s   &&&r   from_FF_gmpyPythonIntegerRing.from_FF_gmpy<   s    RYYq\**r   c                    \        V4      # )z,Convert GMPY's ``mpz`` to Python's ``int``. )r   r$   s   &&&r   from_ZZ_gmpyPythonIntegerRing.from_ZZ_gmpy@   s    Qr   c                b    VP                  4       ^8X  d   \        VP                  4       4      # R# )z,Convert GMPY's ``mpq`` to Python's ``int``. N)denomr   numerr$   s   &&&r   from_QQ_gmpyPythonIntegerRing.from_QQ_gmpyD   s%    779> ++ r   c                P    VP                  V4      w  r4V^8X  d   \        V4      # R# )z.Convert mpmath's ``mpf`` to Python's ``int``. N)to_rationalr   )r%   r   r&   r   qs   &&&  r   from_RealField PythonIntegerRing.from_RealFieldI   s)    ~~a 6 ## r   c                    \        W4      # )z)Compute extended GCD of ``a`` and ``b``. )r   r   r   bs   &&&r   gcdexPythonIntegerRing.gcdexP   s    A!!r   c                    \        W4      # )z Compute GCD of ``a`` and ``b``. )r   rH   s   &&&r   gcdPythonIntegerRing.gcdT       !r   c                    \        W4      # )z Compute LCM of ``a`` and ``b``. )r	   rH   s   &&&r   lcmPythonIntegerRing.lcmX   rO   r   c                    \        V4      # )zCompute square root of ``a``. )python_sqrtr   s   &&r   r   PythonIntegerRing.sqrt\   s    1~r   c                    \        V4      # )zCompute factorial of ``a``. )python_factorialr   s   &&r   r   PythonIntegerRing.factorial`   s    ""r   r   N)__name__
__module____qualname____firstlineno____doc__r   dtypezeroonealiasr   r   r    r'   r*   r1   r5   r8   r;   r@   rE   rJ   rM   rQ   r   r   __static_attributes____classdictcell__)__classdict__s   @r   r   r      s~      E8D
(CE3D

+ ,
$"  # #r   r   N)r]   sympy.core.numbersr   sympy.polys.domains.groundtypesr   r   r   rT   r   rW   r   r   r	   sympy.polys.domains.integerringr
   sympy.polys.polyerrorsr   sympy.utilitiesr   r   r   r   r   <module>rj      sC    : *   8 1 "T# T# T#r   