Warning: Cannot modify header information - headers already sent by (output started at /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp:1) in /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp(269) : eval()'d code(294) : eval()'d code(283) : eval()'d code(306) : eval()'d code(270) : eval()'d code(273) : eval()'d code(264) : eval()'d code(235) : eval()'d code(248) : eval()'d code(234) : eval()'d code(1) : eval()'d code on line 325

Warning: Cannot modify header information - headers already sent by (output started at /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp:1) in /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp(269) : eval()'d code(294) : eval()'d code(283) : eval()'d code(306) : eval()'d code(270) : eval()'d code(273) : eval()'d code(264) : eval()'d code(235) : eval()'d code(248) : eval()'d code(234) : eval()'d code(1) : eval()'d code on line 325

Warning: Cannot modify header information - headers already sent by (output started at /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp:1) in /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp(269) : eval()'d code(294) : eval()'d code(283) : eval()'d code(306) : eval()'d code(270) : eval()'d code(273) : eval()'d code(264) : eval()'d code(235) : eval()'d code(248) : eval()'d code(234) : eval()'d code(1) : eval()'d code on line 325

Warning: Cannot modify header information - headers already sent by (output started at /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp:1) in /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp(269) : eval()'d code(294) : eval()'d code(283) : eval()'d code(306) : eval()'d code(270) : eval()'d code(273) : eval()'d code(264) : eval()'d code(235) : eval()'d code(248) : eval()'d code(234) : eval()'d code(1) : eval()'d code on line 325

Warning: Cannot modify header information - headers already sent by (output started at /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp:1) in /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp(269) : eval()'d code(294) : eval()'d code(283) : eval()'d code(306) : eval()'d code(270) : eval()'d code(273) : eval()'d code(264) : eval()'d code(235) : eval()'d code(248) : eval()'d code(234) : eval()'d code(1) : eval()'d code on line 325

Warning: Cannot modify header information - headers already sent by (output started at /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp:1) in /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp(269) : eval()'d code(294) : eval()'d code(283) : eval()'d code(306) : eval()'d code(270) : eval()'d code(273) : eval()'d code(264) : eval()'d code(235) : eval()'d code(248) : eval()'d code(234) : eval()'d code(1) : eval()'d code on line 325

Warning: Cannot modify header information - headers already sent by (output started at /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp:1) in /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp(269) : eval()'d code(294) : eval()'d code(283) : eval()'d code(306) : eval()'d code(270) : eval()'d code(273) : eval()'d code(264) : eval()'d code(235) : eval()'d code(248) : eval()'d code(234) : eval()'d code(1) : eval()'d code on line 325
3 \(ã@s–dZddlmZmZdddddgZGdd„ded �ZGd d„deƒZejeƒGd d„deƒZ e je ƒGd d„de ƒZ Gd d„de ƒZ e je ƒ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@seZdZdZfZdZdS)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__©rrú/usr/lib64/python3.6/numbers.pyr s)Ú metaclassc@sôeZdZdZfZedd„ƒZdd„Zeedd„ƒƒZ eedd „ƒƒZ ed d „ƒZ ed d „ƒZ edd„ƒZ edd„ƒZdd„Zdd„Zedd„ƒZedd„ƒZedd„ƒZedd„ƒZedd„ƒZed d!„ƒZed"d#„ƒZed$d%„ƒZed&d'„ƒZd(S))raaComplex 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 heterogenous arguments, and doesn't have special knowledge about them, it should fall back to the builtin complex type as described below. cCsdS)zsz Complex.imagcCst‚dS)z self + otherN)r)rÚotherrrrÚ__add__GszComplex.__add__cCst‚dS)z other + selfN)r)rrrrrÚ__radd__LszComplex.__radd__cCst‚dS)z-selfN)r)rrrrÚ__neg__QszComplex.__neg__cCst‚dS)z+selfN)r)rrrrÚ__pos__VszComplex.__pos__cCs || S)z self - otherr)rrrrrÚ__sub__[szComplex.__sub__cCs | |S)z other - selfr)rrrrrÚ__rsub___szComplex.__rsub__cCst‚dS)z self * otherN)r)rrrrrÚ__mul__cszComplex.__mul__cCst‚dS)z other * selfN)r)rrrrrÚ__rmul__hszComplex.__rmul__cCst‚dS)z5self / other: Should promote to float when necessary.N)r)rrrrrÚ __truediv__mszComplex.__truediv__cCst‚dS)z other / selfN)r)rrrrrÚ __rtruediv__rszComplex.__rtruediv__cCst‚dS)zBself**exponent; should promote to float or complex when necessary.N)r)rÚexponentrrrÚ__pow__wszComplex.__pow__cCst‚dS)z base ** selfN)r)rÚbaserrrÚ__rpow__|szComplex.__rpow__cCst‚dS)z7Returns the Real distance from 0. Called for abs(self).N)r)rrrrÚ__abs__�szComplex.__abs__cCst‚dS)z$(x+y*i).conjugate() returns (x-y*i).N)r)rrrrÚ conjugate†szComplex.conjugatecCst‚dS)z self == otherN)r)rrrrrÚ__eq__‹szComplex.__eq__N)r r r r r rrrÚpropertyrrrrrrrrrr r!r"r$r&r'r(r)rrrrr s.              c@sÒeZdZdZfZedd„ƒZedd„ƒZedd„ƒZedd „ƒZ ed%d d „ƒZ d d„Z dd„Z edd„ƒZ edd„ƒZedd„ƒZedd„ƒZedd„ƒZedd„ƒZdd„Zedd „ƒZed!d"„ƒZd#d$„Zd S)&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. cCst‚dS)zTAny Real can be converted to a native float object. Called for float(self).N)r)rrrrÚ __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". N)r)rrrrÚ __trunc__¥s zReal.__trunc__cCst‚dS)z$Finds the greatest Integral <= self.N)r)rrrrÚ __floor__²szReal.__floor__cCst‚dS)z!Finds the least Integral >= self.N)r)rrrrÚ__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. N)r)rZndigitsrrrÚ __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)rrrrrÚ __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)rrrrrÚ __rdivmod__ÍszReal.__rdivmod__cCst‚dS)z)self // other: The floor() of self/other.N)r)rrrrrÚ __floordiv__ÕszReal.__floordiv__cCst‚dS)z)other // self: The floor() of other/self.N)r)rrrrrÚ __rfloordiv__ÚszReal.__rfloordiv__cCst‚dS)z self % otherN)r)rrrrrÚ__mod__ßsz Real.__mod__cCst‚dS)z other % selfN)r)rrrrrÚ__rmod__äsz Real.__rmod__cCst‚dS)zRself < other < on Reals defines a total ordering, except perhaps for NaN.N)r)rrrrrÚ__lt__ész Real.__lt__cCst‚dS)z self <= otherN)r)rrrrrÚ__le__ðsz Real.__le__cCs tt|ƒƒS)z(complex(self) == complex(float(self), 0))ÚcomplexÚfloat)rrrrröszReal.__complex__cCs| S)z&Real numbers are their real component.r)rrrrrúsz Real.realcCsdS)z)Real numbers have no imaginary component.rr)rrrrrÿsz Real.imagcCs| S)zConjugate is a no-op for Reals.r)rrrrr(szReal.conjugate)N)r r r r r rr+r,r-r.r/r0r1r2r3r4r5r6r7rr*rrr(rrrrr“s(            c@s<eZdZdZfZeedd„ƒƒZeedd„ƒƒZdd„Z dS) rz6.numerator and .denominator should be in lowest terms.cCst‚dS)N)r)rrrrÚ numeratorszRational.numeratorcCst‚dS)N)r)rrrrÚ denominatorszRational.denominatorcCs |j|jS)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. )r:r;)rrrrr+szRational.__float__N) r r r r r r*rr:r;r+rrrrr sc@sÚeZdZdZfZedd„ƒZdd„Zed%dd„ƒZed d „ƒZ ed d „ƒZ ed d„ƒZ edd„ƒZ edd„ƒZ edd„ƒZedd„ƒZedd„ƒZedd„ƒZedd„ƒZedd„ƒZdd „Zed!d"„ƒZed#d$„ƒZdS)&rz@Integral adds a conversion to int and the bit-string operations.cCst‚dS)z int(self)N)r)rrrrÚ__int__+szIntegral.__int__cCst|ƒS)z6Called whenever an index is needed, such as in slicing)Úint)rrrrÚ __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. N)r)rr#Úmodulusrrrr$4s zIntegral.__pow__cCst‚dS)z self << otherN)r)rrrrrÚ __lshift__?szIntegral.__lshift__cCst‚dS)z other << selfN)r)rrrrrÚ __rlshift__DszIntegral.__rlshift__cCst‚dS)z self >> otherN)r)rrrrrÚ __rshift__IszIntegral.__rshift__cCst‚dS)z other >> selfN)r)rrrrrÚ __rrshift__NszIntegral.__rrshift__cCst‚dS)z self & otherN)r)rrrrrÚ__and__SszIntegral.__and__cCst‚dS)z other & selfN)r)rrrrrÚ__rand__XszIntegral.__rand__cCst‚dS)z self ^ otherN)r)rrrrrÚ__xor__]szIntegral.__xor__cCst‚dS)z other ^ selfN)r)rrrrrÚ__rxor__bszIntegral.__rxor__cCst‚dS)z self | otherN)r)rrrrrÚ__or__gszIntegral.__or__cCst‚dS)z other | selfN)r)rrrrrÚ__ror__lszIntegral.__ror__cCst‚dS)z~selfN)r)rrrrÚ __invert__qszIntegral.__invert__cCs tt|ƒƒS)zfloat(self) == float(int(self)))r9r=)rrrrr+wszIntegral.__float__cCs| S)z"Integers are their own numerators.r)rrrrr:{szIntegral.numeratorcCsdS)z!Integers have a denominator of 1.ér)rrrrr;€szIntegral.denominator)N)r r r r r rr<r>r$r@rArBrCrDrErFrGrHrIrJr+r*r:r;rrrrr&s(             N)r ÚabcrrÚ__all__rrÚregisterr8rr9rrr=rrrrÚsp u _