+
    lh,                         R t ^ RIHtHt . ROt ! R R]R7      t ! R	 R]4      t]P                  ]4        ! R
 R]4      t	]	P                  ]
4        ! R R]	4      t ! R R]4      t]P                  ]4       R# )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                   "    ] tR t^%tRtRtRtRtR# )r   zAll 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____firstlineno____doc__	__slots____hash____static_attributes__r
       lib/python3.14/numbers.pyr   r   %   s    
 I Hr   )	metaclassc                   N  a  ] tR t^9t o RtRt]R 4       tR t]	]R 4       4       t
]	]R 4       4       t]R 4       t]R 4       t]R 4       t]R	 4       tR
 tR t]R 4       t]R 4       t]R 4       t]R 4       t]R 4       t]R 4       t]R 4       t]R 4       t]R 4       tRtV tR# )r   aN  Complex 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.
c                    R# )z<Return a builtin complex instance. Called for complex(self).Nr
   selfs   &r   __complex__Complex.__complex__F   s    r   c                    V ^ 8g  # )z)True if self != 0. Called for bool(self).r
   r   s   &r   __bool__Complex.__bool__J   s    qyr   c                    \         h)zHRetrieve the real component of this number.

This should subclass Real.
NotImplementedErrorr   s   &r   realComplex.realN   
     "!r   c                    \         h)zMRetrieve the imaginary component of this number.

This should subclass Real.
r    r   s   &r   imagComplex.imagW   r$   r   c                    \         h)zself + otherr    r   others   &&r   __add__Complex.__add__`   
     "!r   c                    \         h)zother + selfr    r)   s   &&r   __radd__Complex.__radd__e   r-   r   c                    \         h)z-selfr    r   s   &r   __neg__Complex.__neg__j   r-   r   c                    \         h)z+selfr    r   s   &r   __pos__Complex.__pos__o   r-   r   c                    W) ,           # )zself - otherr
   r)   s   &&r   __sub__Complex.__sub__t   s    f}r   c                    V ) V,           # )zother - selfr
   r)   s   &&r   __rsub__Complex.__rsub__x   s    uu}r   c                    \         h)zself * otherr    r)   s   &&r   __mul__Complex.__mul__|   r-   r   c                    \         h)zother * selfr    r)   s   &&r   __rmul__Complex.__rmul__   r-   r   c                    \         h)z5self / other: Should promote to float when necessary.r    r)   s   &&r   __truediv__Complex.__truediv__   r-   r   c                    \         h)zother / selfr    r)   s   &&r   __rtruediv__Complex.__rtruediv__   r-   r   c                    \         h)zDself ** exponent; should promote to float or complex when necessary.r    )r   exponents   &&r   __pow__Complex.__pow__   r-   r   c                    \         h)zbase ** selfr    )r   bases   &&r   __rpow__Complex.__rpow__   r-   r   c                    \         h)z7Returns the Real distance from 0. Called for abs(self).r    r   s   &r   __abs__Complex.__abs__   r-   r   c                    \         h)z$(x+y*i).conjugate() returns (x-y*i).r    r   s   &r   	conjugateComplex.conjugate   r-   r   c                    \         h)zself == otherr    r)   s   &&r   __eq__Complex.__eq__   r-   r   r
   N)r   r   r   r   r   r   r   r   r   propertyr"   r&   r+   r/   r2   r5   r8   r;   r>   rA   rD   rG   rK   rO   rR   rU   rX   r   __classdictcell____classdict__s   @r   r   r   9   sp     IK K "  " "  " " " " " " " " " " " " " " " " " " " " " " " " " " "r   c                     a  ] tR t^t o RtRt]R 4       t]R 4       t]R 4       t	]R 4       t
]RR l4       tR tR	 t]R
 4       t]R 4       t]R 4       t]R 4       t]R 4       t]R 4       tR t]R 4       t]R 4       tR tRtV tR# )r   zTo 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.
c                    \         h)zLAny Real can be converted to a native float object.

Called for float(self).r    r   s   &r   	__float__Real.__float__   
    
 "!r   c                    \         h)a  trunc(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".
r    r   s   &r   	__trunc__Real.__trunc__   s
     "!r   c                    \         h)z$Finds the greatest Integral <= self.r    r   s   &r   	__floor__Real.__floor__   r-   r   c                    \         h)z!Finds the least Integral >= self.r    r   s   &r   __ceil__Real.__ceil__   r-   r   Nc                    \         h)zRounds 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__Real.__round__   r$   r   c                "    W,          W,          3# )zdivmod(self, other): The pair (self // other, self % other).

Sometimes this can be computed faster than the pair of
operations.
r
   r)   s   &&r   
__divmod__Real.__divmod__   s     t|,,r   c                "    W,          W,          3# )zdivmod(other, self): The pair (other // self, other % self).

Sometimes this can be computed faster than the pair of
operations.
r
   r)   s   &&r   __rdivmod__Real.__rdivmod__   s     u|,,r   c                    \         h)z)self // other: The floor() of self/other.r    r)   s   &&r   __floordiv__Real.__floordiv__   r-   r   c                    \         h)z)other // self: The floor() of other/self.r    r)   s   &&r   __rfloordiv__Real.__rfloordiv__   r-   r   c                    \         h)zself % otherr    r)   s   &&r   __mod__Real.__mod__   r-   r   c                    \         h)zother % selfr    r)   s   &&r   __rmod__Real.__rmod__   r-   r   c                    \         h)zJself < other

< on Reals defines a total ordering, except perhaps for NaN.r    r)   s   &&r   __lt__Real.__lt__  rb   r   c                    \         h)zself <= otherr    r)   s   &&r   __le__Real.__le__	  r-   r   c                *    \        \        V 4      4      # )z(complex(self) == complex(float(self), 0))complexfloatr   s   &r   r   Real.__complex__  s    uT{##r   c                    V 5# )z&Real numbers are their real component.r
   r   s   &r   r"   	Real.real       ur   c                    ^ # )z)Real numbers have no imaginary component.r
   r   s   &r   r&   	Real.imag       r   c                    V 5# )zConjugate is a no-op for Reals.r
   r   s   &r   rU   Real.conjugate  s	    ur   r
   N)r   r   r   r   r   r   r   r`   rd   rg   rj   rn   rq   rt   rw   rz   r}   r   r   r   r   rZ   r"   r&   rU   r   r[   r\   s   @r   r   r      s,     I" " 
" 
" " " " " " "-- " " " " " " " " " " " "
$     r   c                   b   a  ] tR tRt o RtRt]]R 4       4       t]]R 4       4       t	R t
RtV tR# )r   i$  z6.numerator and .denominator should be in lowest terms.c                    \         hr   r    r   s   &r   	numeratorRational.numerator)  r-   r   c                    \         hr   r    r   s   &r   denominatorRational.denominator.  r-   r   c                `    \        V P                  4      \        V P                  4      ,          # )zfloat(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.

)intr   r   r   s   &r   r`   Rational.__float__4  s#     4>>"S)9)9%:::r   r
   N)r   r   r   r   r   r   rZ   r   r   r   r`   r   r[   r\   s   @r   r   r   $  sM     @I"  " "  "; ;r   c                   (  a  ] tR tRt o RtRt]R 4       tR t]RR l4       t	]R 4       t
]R 4       t]R	 4       t]R
 4       t]R 4       t]R 4       t]R 4       t]R 4       t]R 4       t]R 4       t]R 4       tR t]R 4       t]R 4       tRtV tR# )r   i?  zIntegral adds methods that work on integral numbers.

In short, these are conversion to int, pow with modulus, and the
bit-string operations.
c                    \         h)z	int(self)r    r   s   &r   __int__Integral.__int__H  r-   r   c                    \        V 4      # )z6Called whenever an index is needed, such as in slicing)r   r   s   &r   	__index__Integral.__index__M  s    4yr   Nc                    \         h)a  self ** 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    )r   rJ   moduluss   &&&r   rK   Integral.__pow__Q  s
     "!r   c                    \         h)zself << otherr    r)   s   &&r   
__lshift__Integral.__lshift__\  r-   r   c                    \         h)zother << selfr    r)   s   &&r   __rlshift__Integral.__rlshift__a  r-   r   c                    \         h)zself >> otherr    r)   s   &&r   
__rshift__Integral.__rshift__f  r-   r   c                    \         h)zother >> selfr    r)   s   &&r   __rrshift__Integral.__rrshift__k  r-   r   c                    \         h)zself & otherr    r)   s   &&r   __and__Integral.__and__p  r-   r   c                    \         h)zother & selfr    r)   s   &&r   __rand__Integral.__rand__u  r-   r   c                    \         h)zself ^ otherr    r)   s   &&r   __xor__Integral.__xor__z  r-   r   c                    \         h)zother ^ selfr    r)   s   &&r   __rxor__Integral.__rxor__  r-   r   c                    \         h)zself | otherr    r)   s   &&r   __or__Integral.__or__  r-   r   c                    \         h)zother | selfr    r)   s   &&r   __ror__Integral.__ror__  r-   r   c                    \         h)z~selfr    r   s   &r   
__invert__Integral.__invert__  r-   r   c                *    \        \        V 4      4      # )zfloat(self) == float(int(self)))r   r   r   s   &r   r`   Integral.__float__  s    SYr   c                    V 5# )z"Integers are their own numerators.r
   r   s   &r   r   Integral.numerator  r   r   c                    ^# )z!Integers have a denominator of 1.r
   r   s   &r   r   Integral.denominator  r   r   r
   r   )r   r   r   r   r   r   r   r   r   rK   r   r   r   r   r   r   r   r   r   r   r   r`   rZ   r   r   r   r[   r\   s   @r   r   r   ?  sE     I" " " " " " " " " " " " " " " " " " " " " " " " " "
     r   N)r   r   r   r   r   )r   abcr   r   __all__r   r   registerr   r   r   r   r   r   r
   r   r   <module>r      s   @: (
?	w 	(n"f n"`    s7 sj e ;t ;6ax aF 	  # r   