Home >Common Problem >How many bytes does double occupy?

How many bytes does double occupy?

coldplay.xixi
coldplay.xixiOriginal
2020-12-25 10:36:47105039browse

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!

Statement:
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