How many bytes does Python's floating point number occupy?

anonymity
Release: 2019-06-14 09:48:02
Original
15975 people have browsed it

Floating point numbers are represented by the native double precision (64 bit) of the floating point number on the machine. Provides approximately 17 digits of precision and an exponent ranging from -308 to 308. It is the same as the double type in C language. Python does not support 32-bit single-precision floating point numbers. If your program requires precise control over intervals and numerical precision, consider using the numpy extension library.

How many bytes does Python's floating point number occupy?

Python 3.X provides a precision of 17 digits by default for floating point numbers.

Popular explanation about single precision and double precision:

Single precision type and double precision type, their type specifier is float single precision specifier, double double precision specifier. In Turbo C, the single precision type occupies 4 bytes (32 bits) of memory space, its value range is 3.4E-38 ~ 3.4E 38, and can only provide seven significant digits. The double precision type occupies 8 bytes (64 bits) of memory space, its value range is 1.7E-308 ~ 1.7E 308, and can provide 16 significant digits.

The above is the detailed content of How many bytes does Python's floating point number occupy?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template