Your IP : 18.226.34.148


Current Path : /opt/alt/python312/lib64/python3.12/__pycache__/
Upload File :
Current File : //opt/alt/python312/lib64/python3.12/__pycache__/numbers.cpython-312.opt-1.pyc

�

�Q�f�,���dZddlmZmZgd�ZGd�de��ZGd�de�Zeje�Gd	�d
e�Z	e	je
�Gd�de	�ZGd
�de�Zeje
�y)z~Abstract Base Classes (ABCs) for numbers, according to PEP 3141.

TODO: Fill out more detailed documentation on the operators.�)�ABCMeta�abstractmethod)�Number�Complex�Real�Rational�Integralc��eZdZdZdZdZy)rz�All numbers inherit from this class.

    If you just want to check if an argument x is a number, without
    caring what kind, use isinstance(x, Number).
    �N)�__name__�
__module__�__qualname__�__doc__�	__slots__�__hash__r��./opt/alt/python312/lib64/python3.12/numbers.pyrr%s���
�I��Hrr)�	metaclassc�:�eZdZdZdZed��Zd�Zeed���Z	eed���Z
ed��Zed��Zed	��Z
ed
��Zd�Zd�Zed
��Zed��Zed��Zed��Zed��Zed��Zed��Zed��Zed��Zy)rafComplex defines the operations that work on the builtin complex type.

    In short, those are: a conversion to complex, .real, .imag, +, -,
    *, /, **, abs(), .conjugate, ==, and !=.

    If it is given heterogeneous arguments, and doesn't have special
    knowledge about them, it should fall back to the builtin complex
    type as described below.
    rc��y)z<Return a builtin complex instance. Called for complex(self).Nr��selfs r�__complex__zComplex.__complex__Fs�rc��|dk7S)z)True if self != 0. Called for bool(self).rrrs r�__bool__zComplex.__bool__Js���q�y�rc��t�)zXRetrieve the real component of this number.

        This should subclass Real.
        ��NotImplementedErrorrs r�realzComplex.realN�
��"�!rc��t�)z]Retrieve the imaginary component of this number.

        This should subclass Real.
        rrs r�imagzComplex.imagWr rc��t�)zself + otherr�r�others  r�__add__zComplex.__add__`�
��"�!rc��t�)zother + selfrr$s  r�__radd__zComplex.__radd__er'rc��t�)z-selfrrs r�__neg__zComplex.__neg__jr'rc��t�)z+selfrrs r�__pos__zComplex.__pos__or'rc��||zS)zself - otherrr$s  r�__sub__zComplex.__sub__ts���u�f�}�rc��||zS)zother - selfrr$s  r�__rsub__zComplex.__rsub__xs���u�u�}�rc��t�)zself * otherrr$s  r�__mul__zComplex.__mul__|r'rc��t�)zother * selfrr$s  r�__rmul__zComplex.__rmul__�r'rc��t�)z5self / other: Should promote to float when necessary.rr$s  r�__truediv__zComplex.__truediv__�r'rc��t�)zother / selfrr$s  r�__rtruediv__zComplex.__rtruediv__�r'rc��t�)zDself ** exponent; should promote to float or complex when necessary.r)r�exponents  r�__pow__zComplex.__pow__�r'rc��t�)zbase ** selfr)r�bases  r�__rpow__zComplex.__rpow__�r'rc��t�)z7Returns the Real distance from 0. Called for abs(self).rrs r�__abs__zComplex.__abs__�r'rc��t�)z$(x+y*i).conjugate() returns (x-y*i).rrs r�	conjugatezComplex.conjugate�r'rc��t�)z
self == otherrr$s  r�__eq__zComplex.__eq__�r'rN)rr
rrrrrr�propertyrr"r&r)r+r-r/r1r3r5r7r9r<r?rArCrErrrrr9sm����I��K��K����"���"���"���"��"��"��"��"��"��"��"��"����"��"��"��"��"��"��"��"��"��"��"��"��"��"��"��"��"��"rrc��eZdZdZdZed��Zed��Zed��Zed��Z	edd��Z
d	�Zd
�Zed��Z
ed��Zed
��Zed��Zed��Zed��Zd�Zed��Zed��Zd�Zy)rz�To Complex, Real adds the operations that work on real numbers.

    In short, those are: a conversion to float, trunc(), divmod,
    %, <, <=, >, and >=.

    Real also provides defaults for the derived operations.
    rc��t�)zTAny Real can be converted to a native float object.

        Called for float(self).rrs r�	__float__zReal.__float__��
��
"�!rc��t�)aKtrunc(self): Truncates self to an Integral.

        Returns an Integral i such that:
          * i > 0 iff self > 0;
          * abs(i) <= abs(self);
          * for any Integral j satisfying the first two conditions,
            abs(i) >= abs(j) [i.e. i has "maximal" abs among those].
        i.e. "truncate towards 0".
        rrs r�	__trunc__zReal.__trunc__�s
��"�!rc��t�)z$Finds the greatest Integral <= self.rrs r�	__floor__zReal.__floor__�r'rc��t�)z!Finds the least Integral >= self.rrs r�__ceil__z
Real.__ceil__�r'rNc��t�)z�Rounds self to ndigits decimal places, defaulting to 0.

        If ndigits is omitted or None, returns an Integral, otherwise
        returns a Real. Rounds half toward even.
        r)r�ndigitss  r�	__round__zReal.__round__�r rc��||z||zfS)z�divmod(self, other): The pair (self // other, self % other).

        Sometimes this can be computed faster than the pair of
        operations.
        rr$s  r�
__divmod__zReal.__divmod__�s����
�t�e�|�,�,rc��||z||zfS)z�divmod(other, self): The pair (other // self, other % self).

        Sometimes this can be computed faster than the pair of
        operations.
        rr$s  r�__rdivmod__zReal.__rdivmod__�s����
�u�t�|�,�,rc��t�)z)self // other: The floor() of self/other.rr$s  r�__floordiv__zReal.__floordiv__�r'rc��t�)z)other // self: The floor() of other/self.rr$s  r�
__rfloordiv__zReal.__rfloordiv__�r'rc��t�)zself % otherrr$s  r�__mod__zReal.__mod__�r'rc��t�)zother % selfrr$s  r�__rmod__z
Real.__rmod__�r'rc��t�)zRself < other

        < on Reals defines a total ordering, except perhaps for NaN.rr$s  r�__lt__zReal.__lt__rJrc��t�)z
self <= otherrr$s  r�__le__zReal.__le__	r'rc�*�tt|��S)z(complex(self) == complex(float(self), 0))�complex�floatrs rrzReal.__complex__s���u�T�{�#�#rc��|�S)z&Real numbers are their real component.rrs rrz	Real.real����u�rc��y)z)Real numbers have no imaginary component.rrrs rr"z	Real.imag���rc��|�S)zConjugate is a no-op for Reals.rrs rrCzReal.conjugates	���u�r�N)rr
rrrrrIrLrNrPrSrUrWrYr[r]r_rarcrrFrr"rCrrrrr�s$����I��"��"��
"��
"��"��"��"��"��"��"�-�-��"��"��"��"��"��"��"��"��"��"��"��"�
$���������rrc�N�eZdZdZdZeed���Zeed���Zd�Z	y)rz6.numerator and .denominator should be in lowest terms.rc��t�rlrrs r�	numeratorzRational.numerator)r'rc��t�rlrrs r�denominatorzRational.denominator.r'rc�X�t|j�t|j�zS)afloat(self) = self.numerator / self.denominator

        It's important that this conversion use the integer's "true"
        division rather than casting one side to float before dividing
        so that ratios of huge integers convert without overflowing.

        )�introrqrs rrIzRational.__float__4s#���4�>�>�"�S��)9�)9�%:�:�:rN)
rr
rrrrFrrorqrIrrrrr$sE��@��I�
��"���"���"���"�;rrc��eZdZdZdZed��Zd�Zedd��Zed��Z	ed��Z
ed	��Zed
��Zed��Z
ed��Zed
��Zed��Zed��Zed��Zed��Zd�Zed��Zed��Zy)r	z�Integral adds methods that work on integral numbers.

    In short, these are conversion to int, pow with modulus, and the
    bit-string operations.
    rc��t�)z	int(self)rrs r�__int__zIntegral.__int__Hr'rc��t|�S)z6Called whenever an index is needed, such as in slicing)rsrs r�	__index__zIntegral.__index__Ms���4�y�rNc��t�)a4self ** exponent % modulus, but maybe faster.

        Accept the modulus argument if you want to support the
        3-argument version of pow(). Raise a TypeError if exponent < 0
        or any argument isn't Integral. Otherwise, just implement the
        2-argument version described in Complex.
        r)rr;�moduluss   rr<zIntegral.__pow__Qs
��"�!rc��t�)z
self << otherrr$s  r�
__lshift__zIntegral.__lshift__\r'rc��t�)z
other << selfrr$s  r�__rlshift__zIntegral.__rlshift__ar'rc��t�)z
self >> otherrr$s  r�
__rshift__zIntegral.__rshift__fr'rc��t�)z
other >> selfrr$s  r�__rrshift__zIntegral.__rrshift__kr'rc��t�)zself & otherrr$s  r�__and__zIntegral.__and__pr'rc��t�)zother & selfrr$s  r�__rand__zIntegral.__rand__ur'rc��t�)zself ^ otherrr$s  r�__xor__zIntegral.__xor__zr'rc��t�)zother ^ selfrr$s  r�__rxor__zIntegral.__rxor__r'rc��t�)zself | otherrr$s  r�__or__zIntegral.__or__�r'rc��t�)zother | selfrr$s  r�__ror__zIntegral.__ror__�r'rc��t�)z~selfrrs r�
__invert__zIntegral.__invert__�r'rc�*�tt|��S)zfloat(self) == float(int(self)))rfrsrs rrIzIntegral.__float__�s���S��Y��rc��|�S)z"Integers are their own numerators.rrs rrozIntegral.numerator�rhrc��y)z!Integers have a denominator of 1.�rrs rrqzIntegral.denominator�rjrrl)rr
rrrrrvrxr<r|r~r�r�r�r�r�r�r�r�r�rIrFrorqrrrr	r	?sB����I��"��"���"��"��"��"��"��"��"��"��"��"��"��"��"��"��"��"��"��"��"��"��"��"��"��"�
 ��������rr	N)r�abcrr�__all__rr�registerrerrfrr	rsrrr�<module>r�s���@�:(�
?��	�w�	�(n"�f�n"�`�����s�7�s�j�
�
�e��;�t�;�6a�x�a�F	���#�r

?>