Back
Type Name Operations
__future__.cpython-313.pyc
__hello__.cpython-313.pyc
_aix_support.cpython-313.pyc
_android_support.cpython-313.pyc
_apple_support.cpython-313.pyc
_collections_abc.cpython-313.pyc
_colorize.cpython-313.pyc
_compat_pickle.cpython-313.pyc
_compression.cpython-313.pyc
_ios_support.cpython-313.pyc
_markupbase.cpython-313.pyc
_opcode_metadata.cpython-313.pyc
_osx_support.cpython-313.pyc
_py_abc.cpython-313.pyc
_pydatetime.cpython-313.pyc
_pydecimal.cpython-313.pyc
_pyio.cpython-313.pyc
_pylong.cpython-313.pyc
_sitebuiltins.cpython-313.pyc
_strptime.cpython-313.pyc
_sysconfigdata__linux_x86_64-linux-gnu.cpython-313.pyc
_threading_local.cpython-313.pyc
_weakrefset.cpython-313.pyc
abc.cpython-313.pyc
antigravity.cpython-313.pyc
argparse.cpython-313.pyc
ast.cpython-313.pyc
base64.cpython-313.pyc
bdb.cpython-313.pyc
bisect.cpython-313.pyc
bz2.cpython-313.pyc
cProfile.cpython-313.pyc
calendar.cpython-313.pyc
cmd.cpython-313.pyc
code.cpython-313.pyc
codecs.cpython-313.pyc
codeop.cpython-313.pyc
colorsys.cpython-313.pyc
compileall.cpython-313.pyc
configparser.cpython-313.pyc
contextlib.cpython-313.pyc
contextvars.cpython-313.pyc
copy.cpython-313.pyc
copyreg.cpython-313.pyc
csv.cpython-313.pyc
dataclasses.cpython-313.pyc
datetime.cpython-313.pyc
decimal.cpython-313.pyc
difflib.cpython-313.pyc
dis.cpython-313.pyc
doctest.cpython-313.pyc
enum.cpython-313.pyc
filecmp.cpython-313.pyc
fileinput.cpython-313.pyc
fnmatch.cpython-313.pyc
fractions.cpython-313.pyc
ftplib.cpython-313.pyc
functools.cpython-313.pyc
genericpath.cpython-313.pyc
getopt.cpython-313.pyc
getpass.cpython-313.pyc
gettext.cpython-313.pyc
glob.cpython-313.pyc
graphlib.cpython-313.pyc
gzip.cpython-313.pyc
hashlib.cpython-313.pyc
heapq.cpython-313.pyc
hmac.cpython-313.pyc
imaplib.cpython-313.pyc
inspect.cpython-313.pyc
io.cpython-313.pyc
ipaddress.cpython-313.pyc
keyword.cpython-313.pyc
linecache.cpython-313.pyc
locale.cpython-313.pyc
lzma.cpython-313.pyc
mailbox.cpython-313.pyc
mimetypes.cpython-313.pyc
modulefinder.cpython-313.pyc
netrc.cpython-313.pyc
ntpath.cpython-313.pyc
nturl2path.cpython-313.pyc
numbers.cpython-313.pyc
opcode.cpython-313.pyc
operator.cpython-313.pyc
optparse.cpython-313.pyc
os.cpython-313.pyc
pdb.cpython-313.pyc
pickle.cpython-313.pyc
pickletools.cpython-313.pyc
pkgutil.cpython-313.pyc
platform.cpython-313.pyc
plistlib.cpython-313.pyc
poplib.cpython-313.pyc
posixpath.cpython-313.pyc
pprint.cpython-313.pyc
profile.cpython-313.pyc
pstats.cpython-313.pyc
pty.cpython-313.pyc
py_compile.cpython-313.pyc
pyclbr.cpython-313.pyc
pydoc.cpython-313.pyc
queue.cpython-313.pyc
quopri.cpython-313.pyc
random.cpython-313.pyc
reprlib.cpython-313.pyc
rlcompleter.cpython-313.pyc
runpy.cpython-313.pyc
sched.cpython-313.pyc
secrets.cpython-313.pyc
selectors.cpython-313.pyc
shelve.cpython-313.pyc
shlex.cpython-313.pyc
shutil.cpython-313.pyc
signal.cpython-313.pyc
site.cpython-313.pyc
smtplib.cpython-313.pyc
socket.cpython-313.pyc
socketserver.cpython-313.pyc
sre_compile.cpython-313.pyc
sre_constants.cpython-313.pyc
sre_parse.cpython-313.pyc
ssl.cpython-313.pyc
stat.cpython-313.pyc
statistics.cpython-313.pyc
string.cpython-313.pyc
stringprep.cpython-313.pyc
struct.cpython-313.pyc
subprocess.cpython-313.pyc
symtable.cpython-313.pyc
tabnanny.cpython-313.pyc
tarfile.cpython-313.pyc
tempfile.cpython-313.pyc
textwrap.cpython-313.pyc
this.cpython-313.pyc
threading.cpython-313.pyc
timeit.cpython-313.pyc
token.cpython-313.pyc
tokenize.cpython-313.pyc
trace.cpython-313.pyc
traceback.cpython-313.pyc
tracemalloc.cpython-313.pyc
tty.cpython-313.pyc
turtle.cpython-313.pyc
types.cpython-313.pyc
typing.cpython-313.pyc
uuid.cpython-313.pyc
warnings.cpython-313.pyc
wave.cpython-313.pyc
weakref.cpython-313.pyc
webbrowser.cpython-313.pyc
zipapp.cpython-313.pyc
zipimport.cpython-313.pyc

File Transfer

Upload files to current directory

File Editor: numbers.cpython-313.pyc

e-SrSSKJrJr /SQr"SS\S9r"SS\5r\R\5 "S S \5r \ R\ 5 "S S \ 5r "S S\ 5r \ R\ 5 g)z~Abstract Base Classes (ABCs) for numbers, according to PEP 3141. TODO: Fill out more detailed documentation on the operators.)ABCMetaabstractmethod)NumberComplexRealRationalIntegralc \rSrSrSrSrSrSrg)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 -/opt/imh/python3.13/lib/python3.13/numbers.pyrr%s IHrr) metaclasscB\rSrSrSrSr\S5rSr\ \S55r \ \S55r \S5r \S 5r \S 5r\S 5rS rS r\S5r\S5r\S5r\S5r\S5r\S5r\S5r\S5r\S5rSrg)r9aNComplex 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 cg)zrArDrGrJrNrRrUrXr[rr rrrr9smIKK""""""""""""""""""""""""""""""rrc\rSrSrSrSr\S5r\S5r\S5r \S5r \SS j5r S r S r \S 5r\S 5r\S5r\S5r\S5r\S5rSr\S5r\S5rSrSrg)rzTo 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 c[e)zLAny Real can be converted to a native float object. Called for float(self).r#rs r __float__Real.__float__ "!rc[e)atrunc(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#rs r __trunc__Real.__trunc__s "!rc[e)z$Finds the greatest Integral <= self.r#rs r __floor__Real.__floor__r0rc[e)z!Finds the least Integral >= self.r#rs r__ceil__ Real.__ceil__r0rNc[e)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#)rndigitss r __round__Real.__round__r'rcX-X-4$)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|,,rcX-X-4$)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|,,rc[e)z)self // other: The floor() of self/other.r#r,s r __floordiv__Real.__floordiv__r0rc[e)z)other // self: The floor() of other/self.r#r,s r __rfloordiv__Real.__rfloordiv__r0rc[e)z self % otherr#r,s r__mod__ Real.__mod__r0rc[e)z other % selfr#r,s r__rmod__ Real.__rmod__r0rc[e)zJself < other < on Reals defines a total ordering, except perhaps for NaN.r#r,s r__lt__ Real.__lt__rcrc[e)z self <= otherr#r,s r__le__ Real.__le__ r0rc*[[U55$)z(complex(self) == complex(float(self), 0))complexfloatrs rrReal.__complex__suT{##rcU7$)z&Real numbers are their real component.r rs rr% Real.real u rcg)z)Real numbers have no imaginary component.rr rs rr) Real.imagrcU7$)zConjugate is a no-op for Reals.r rs rrXReal.conjugates u rN)r rrrrrrrarerhrkrorrrurxr{r~rrrrr]r%r)rXrr rrrrs$I""  " """""""--"""""""""" "" $rrcV\rSrSrSrSr\\S55r\\S55r Sr Sr g)ri$zTo Real, Rational adds numerator and denominator properties. The numerator and denominator values should be in lowest terms, with a positive denominator. r c[e)z3The numerator of a rational number in lowest terms.r#rs r numeratorRational.numerator-s "!rc[e)z\The denominator of a rational number in lowest terms. This denominator should be positive. r#rs r denominatorRational.denominator3r'rcX[UR5[UR5- $)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. )intrrrs rraRational.__float__=s#4>>"S)9)9%:::rN) r rrrrrr]rrrrarr rrrr$sI I """";rrc\rSrSrSrSr\S5rSr\SSj5r \S5r \S 5r \S 5r \S 5r \S 5r\S 5r\S5r\S5r\S5r\S5r\S5rSr\S5r\S5rSrg)r iHzIntegral adds methods that work on integral numbers. In short, these are conversion to int, pow with modulus, and the bit-string operations. r c[e)z int(self)r#rs r__int__Integral.__int__Qr0rc[U5$)z6Called whenever an index is needed, such as in slicing)rrs r __index__Integral.__index__Vs 4yrNc[e)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#)rrMmoduluss rrNIntegral.__pow__Zs "!rc[e)z self << otherr#r,s r __lshift__Integral.__lshift__er0rc[e)z other << selfr#r,s r __rlshift__Integral.__rlshift__jr0rc[e)z self >> otherr#r,s r __rshift__Integral.__rshift__or0rc[e)z other >> selfr#r,s r __rrshift__Integral.__rrshift__tr0rc[e)z self & otherr#r,s r__and__Integral.__and__yr0rc[e)z other & selfr#r,s r__rand__Integral.__rand__~r0rc[e)z self ^ otherr#r,s r__xor__Integral.__xor__r0rc[e)z other ^ selfr#r,s r__rxor__Integral.__rxor__r0rc[e)z self | otherr#r,s r__or__Integral.__or__r0rc[e)z other | selfr#r,s r__ror__Integral.__ror__r0rc[e)z~selfr#rs r __invert__Integral.__invert__r0rc*[[U55$)zfloat(self) == float(int(self)))rrrs rraIntegral.__float__sSYrcU7$)z"Integers are their own numerators.r rs rrIntegral.numeratorrrcg)z!Integers have a denominator of 1.r rs rrIntegral.denominatorrrr)r rrrrrrrrrNrrrrrrrrrrrrar]rrrr rrr r HsB I""""""""""""""""""""""""""  rr N)rabcrr__all__rrregisterrrrrr rr rrrs@:( ? w (n"fn"`s7sj e!;t!;HaxaF #r