� c��j�,����dZddlmZmZgd�ZGd�de��ZGd�de�Zeje�Gd �d e�Z e je �Gd �d e �Z Gd �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 �� /usr/lib64/python3.12/numbers.pyrr%s��� �I��Hrr)� metaclassc�:�eZdZdZdZed��Zd�Zeed���Z eed���Z ed��Z ed��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. r c��y)z, and >=. Real also provides defaults for the derived operations. r c��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. r r$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. r r$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__z Real.__lt__rJrc��t�)z self <= otherrr$s r�__le__z Real.__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.r rs rrz Real.real� ���u� rc��y)z)Real numbers have no imaginary component.rr rs rr"z Real.imag���rc��|�S)zConjugate is a no-op for Reals.r rs rrCzReal.conjugates ���u� r�N)r r rrrrrIrLrNrPrSrUrWrYr[r]r_rarcrrFrr"rCr rrrr�s$����I��"��"� � "�� "��"��"��"��"��"��"�-�-��"��"��"��"��"��"��"��"��"��"� �"��"� $���������rrc�N�eZdZdZdZeed���Zeed���Zd�Z y)rz6.numerator and .denominator should be in lowest terms.r c��t�rlrrs r� numeratorzRational.numerator)r'rc��t�rlrrs r� denominatorzRational.denominator.r'rc�X�t|j�t|j�z S)a float(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 rrrrFrrorqrIr rrrr$sE��@��I� ��"���"���"���"�;rrc��eZdZdZdZed��Zd�Zedd��Zed��Z ed��Z ed ��Z ed ��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. r c��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.r rs rrozIntegral.numerator�rhrc��y)z!Integers have a denominator of 1.�r rs rrqzIntegral.denominator�rjrrl)r r rrrrrvrxr<r|r~r�r�r�r�r�r�r�r�r�rIrFrorqr rrr r ?sB��� �I��"��"���"��"��"��"��"��"��"��"��"��"��"��"��"��"��"��"��"��"��"��"��"��"��"��"�  ��������rr N)r�abcrr�__all__rr�registerrerrfrr rsr rr�r�s���@�:(� ?�� �w� �(n"�f�n"�`�����s�7�s�j� � �e��;�t�;�6a�x�a�F ���#�r