ok

Mini Shell

Direktori : /opt/alt/python38/lib64/python3.8/__pycache__/
Upload File :
Current File : //opt/alt/python38/lib64/python3.8/__pycache__/numbers.cpython-38.pyc

U

.��c(�@s�dZddlmZmZdddddgZGdd�ded	�ZGd
d�de�Ze�e�Gdd�de�Z	e	�e
�Gdd�de	�ZGd
d�de�Ze�e
�dS)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@seZdZdZdZdZdS)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	r	r	�,/opt/alt/python38/lib64/python3.8/numbers.pyrs)�	metaclassc@s�eZdZdZdZedd��Zdd�Zeedd���Z	eed	d
���Z
edd��Zed
d��Zedd��Z
edd��Zdd�Zdd�Zedd��Zedd��Zedd��Zedd��Zedd ��Zed!d"��Zed#d$��Zed%d&��Zed'd(��Zd)S)*rabComplex 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	cCsdS)z<Return a builtin complex instance. Called for complex(self).Nr	��selfr	r	r�__complex__-szComplex.__complex__cCs|dkS)z)True if self != 0. Called for bool(self).rr	rr	r	r�__bool__1szComplex.__bool__cCst�dS)zXRetrieve the real component of this number.

        This should subclass Real.
        N��NotImplementedErrorrr	r	r�real5szComplex.realcCst�dS)z]Retrieve the imaginary component of this number.

        This should subclass Real.
        Nrrr	r	r�imag>szComplex.imagcCst�dS)zself + otherNr�r�otherr	r	r�__add__GszComplex.__add__cCst�dS)zother + selfNrrr	r	r�__radd__LszComplex.__radd__cCst�dS)z-selfNrrr	r	r�__neg__QszComplex.__neg__cCst�dS)z+selfNrrr	r	r�__pos__VszComplex.__pos__cCs
||S)zself - otherr	rr	r	r�__sub__[szComplex.__sub__cCs
||S)zother - selfr	rr	r	r�__rsub___szComplex.__rsub__cCst�dS)zself * otherNrrr	r	r�__mul__cszComplex.__mul__cCst�dS)zother * selfNrrr	r	r�__rmul__hszComplex.__rmul__cCst�dS)z5self / other: Should promote to float when necessary.Nrrr	r	r�__truediv__mszComplex.__truediv__cCst�dS)zother / selfNrrr	r	r�__rtruediv__rszComplex.__rtruediv__cCst�dS)zBself**exponent; should promote to float or complex when necessary.Nr)r�exponentr	r	r�__pow__wszComplex.__pow__cCst�dS)zbase ** selfNr)r�baser	r	r�__rpow__|szComplex.__rpow__cCst�dS)z7Returns the Real distance from 0. Called for abs(self).Nrrr	r	r�__abs__�szComplex.__abs__cCst�dS)z$(x+y*i).conjugate() returns (x-y*i).Nrrr	r	r�	conjugate�szComplex.conjugatecCst�dS)z
self == otherNrrr	r	r�__eq__�szComplex.__eq__N)r
rrr
rrrr�propertyrrrrrrr r!r"r#r$r%r'r)r*r+r,r	r	r	rr sN













c@s�eZdZdZdZedd��Zedd��Zedd��Zed	d
��Z	ed&dd
��Z
dd�Zdd�Zedd��Z
edd��Zedd��Zedd��Zedd��Zedd��Zdd�Zed d!��Zed"d#��Zd$d%�ZdS)'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.
    r	cCst�dS)zTAny Real can be converted to a native float object.

        Called for float(self).Nrrr	r	r�	__float__�szReal.__float__cCst�dS)aGtrunc(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".
        Nrrr	r	r�	__trunc__�szReal.__trunc__cCst�dS)z$Finds the greatest Integral <= self.Nrrr	r	r�	__floor__�szReal.__floor__cCst�dS)z!Finds the least Integral >= self.Nrrr	r	r�__ceil__�sz
Real.__ceil__NcCst�dS)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.
        Nr)rZndigitsr	r	r�	__round__�szReal.__round__cCs||||fS)z�divmod(self, other): The pair (self // other, self % other).

        Sometimes this can be computed faster than the pair of
        operations.
        r	rr	r	r�
__divmod__�szReal.__divmod__cCs||||fS)z�divmod(other, self): The pair (self // other, self % other).

        Sometimes this can be computed faster than the pair of
        operations.
        r	rr	r	r�__rdivmod__�szReal.__rdivmod__cCst�dS)z)self // other: The floor() of self/other.Nrrr	r	r�__floordiv__�szReal.__floordiv__cCst�dS)z)other // self: The floor() of other/self.Nrrr	r	r�
__rfloordiv__�szReal.__rfloordiv__cCst�dS)zself % otherNrrr	r	r�__mod__�szReal.__mod__cCst�dS)zother % selfNrrr	r	r�__rmod__�sz
Real.__rmod__cCst�dS)zRself < other

        < on Reals defines a total ordering, except perhaps for NaN.Nrrr	r	r�__lt__�szReal.__lt__cCst�dS)z
self <= otherNrrr	r	r�__le__�szReal.__le__cCstt|��S)z(complex(self) == complex(float(self), 0))�complex�floatrr	r	rr�szReal.__complex__cCs|
S)z&Real numbers are their real component.r	rr	r	rr�sz	Real.realcCsdS)z)Real numbers have no imaginary component.rr	rr	r	rr�sz	Real.imagcCs|
S)zConjugate is a no-op for Reals.r	rr	r	rr+szReal.conjugate)N)r
rrr
rrr.r/r0r1r2r3r4r5r6r7r8r9r:rr-rrr+r	r	r	rr�s@











c@s<eZdZdZdZeedd���Zeedd���Zdd�Z	d	S)
rz6.numerator and .denominator should be in lowest terms.r	cCst�dS�Nrrr	r	r�	numeratorszRational.numeratorcCst�dSr=rrr	r	r�denominatorszRational.denominatorcCs|j|jS)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.

        )r>r?rr	r	rr.szRational.__float__N)
r
rrr
rr-rr>r?r.r	r	r	rrsc@s�eZdZdZdZedd��Zdd�Zed&dd	��Zed
d��Z	edd
��Z
edd��Zedd��Zedd��Z
edd��Zedd��Zedd��Zedd��Zedd��Zedd��Zd d!�Zed"d#��Zed$d%��ZdS)'rz@Integral adds a conversion to int and the bit-string operations.r	cCst�dS)z	int(self)Nrrr	r	r�__int__+szIntegral.__int__cCst|�S)z6Called whenever an index is needed, such as in slicing)�intrr	r	r�	__index__0szIntegral.__index__NcCst�dS)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.
        Nr)rr&�modulusr	r	rr'4s	zIntegral.__pow__cCst�dS)z
self << otherNrrr	r	r�
__lshift__?szIntegral.__lshift__cCst�dS)z
other << selfNrrr	r	r�__rlshift__DszIntegral.__rlshift__cCst�dS)z
self >> otherNrrr	r	r�
__rshift__IszIntegral.__rshift__cCst�dS)z
other >> selfNrrr	r	r�__rrshift__NszIntegral.__rrshift__cCst�dS)zself & otherNrrr	r	r�__and__SszIntegral.__and__cCst�dS)zother & selfNrrr	r	r�__rand__XszIntegral.__rand__cCst�dS)zself ^ otherNrrr	r	r�__xor__]szIntegral.__xor__cCst�dS)zother ^ selfNrrr	r	r�__rxor__bszIntegral.__rxor__cCst�dS)zself | otherNrrr	r	r�__or__gszIntegral.__or__cCst�dS)zother | selfNrrr	r	r�__ror__lszIntegral.__ror__cCst�dS)z~selfNrrr	r	r�
__invert__qszIntegral.__invert__cCstt|��S)zfloat(self) == float(int(self)))r<rArr	r	rr.wszIntegral.__float__cCs|
S)z"Integers are their own numerators.r	rr	r	rr>{szIntegral.numeratorcCsdS)z!Integers have a denominator of 1.�r	rr	r	rr?�szIntegral.denominator)N)r
rrr
rrr@rBr'rDrErFrGrHrIrJrKrLrMrNr.r-r>r?r	r	r	rr&sD













N)r
�abcrr�__all__rr�registerr;rr<rrrAr	r	r	r�<module>sp
u
_

Zerion Mini Shell 1.0