The following editor will bring you a brief discussion of digital types and processing tools in Python. The editor thinks it’s pretty good, so I’ll share it with you now and give it as a reference. Let’s follow the editor and take a look
Number type tools in python
Python provides a lot of advanced numerical programming for more advanced work Support and objects, including complete tools for numeric types:
1. Integers and floating point types,
2. Complex numbers,
3. Fixed-precision decimal numbers,
4. Rational fractions,
5. Sets,
6. Boolean type
7. Infinite integer precision
8. Various digital built-in functions and modules.
Basic number types
Python provides two basic types: integers (positive integers, negative integers) and floating point numbers (Note: Numbers with decimal parts), where in python we can use integers in multiple bases. And integers can be used with infinite precision.
The integer is expressed in decimal number string writing, and the floating point number is represented by a decimal point or scientific notation e. In the python2 version, integers are also divided into general integers (32 bits) and long integers (infinite precision). Long integers end with l. With python3, integers have only one form, with infinite precision.
Of course, integers in Python also appear in binary (0bxxxxxxxx), octal (0oxxxxxxxx), and hexadecimal (0x xxxxxxxx) forms.
Conversion between decimal numbers and other bases:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn