Home > Common Problem > body text

How many bytes does double occupy?

coldplay.xixi
Release: 2023-02-08 18:00:09
Original
104989 people have browsed it

The bytes occupied by double: 1. Under the 16-bit compiler, the double occupies 8 bytes; 2. Under the 32-bit compiler, the double occupies 8 bytes; 3. Under the 64-bit compiler, double occupies 8 bytes.

How many bytes does double occupy?

#The operating environment of this article: windows10 system, thinkpad t480 computer.

Bytes occupied by double:

1. 16-bit compiler

  • char: 1 byte

  • char* (i.e. pointer variable): 2 bytes

  • short int : 2 bytes

  • int: 2 bytes

  • unsigned int: 2 bytes

  • float: 4 Bytes

  • double: 8 bytes

  • long: 4 bytes

  • long long: 8 bytes

  • unsigned long: 4 bytes

##2, 32 Bit compiler

  • char: 1 byte

  • char* (i.e. pointer variable): 4 bytes (32 The bit addressing space is 2^32, which is 32 bits, which is 4 bytes. The same applies to 64-bit compilers)

  • short int: 2 bytes

  • int: 4 bytes

  • unsigned int: 4 bytes

  • float: 4 Bytes

  • double: 8 bytes

  • long: 4 bytes

  • long long: 8 bytes

  • unsigned long: 4 bytes

3. 64-bit compiler

  • char: 1 byte

  • char* (i.e. pointer variable): 8 bytes

  • short int: 2 bytes

  • int: 4 bytes

  • unsigned int : 4 bytes

  • float: 4 bytes

  • ##double: 8 bytes

  • long: 8 bytes
  • long long: 8 bytes
  • unsigned long: 8 Bytes
# If you want to know more about programming learning, please pay attention to the
php training

column!

The above is the detailed content of How many bytes does double 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