Home Common Problem How many bytes does double occupy?

How many bytes does double occupy?

Dec 25, 2020 am 10:36 AM
double

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

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Repo: How To Revive Teammates
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

C++ program to convert double type variable to int type C++ program to convert double type variable to int type Aug 25, 2023 pm 08:25 PM

In C++, variables of type int can only hold positive or negative integer values; they cannot hold decimal values. There are float and double values ​​available for this purpose. The double data type was created to store decimals up to seven digits after the decimal point. Conversion of an integer to a double data type can be done automatically by the compiler (called an "implicit" conversion), or it can be explicitly requested by the programmer from the compiler (called an "explicit" conversion). In the following sections, we'll cover various conversion methods. Implicit conversions The compiler performs implicit type conversions automatically. To achieve this, two variables are required - one of floating point type and the other of integer type. When we simply assign a floating point value or variable to an integer variable, the compiler takes care of all the other things

What is the difference between float and double What is the difference between float and double Oct 11, 2023 pm 05:38 PM

The main differences between float and double lie in precision, storage and calculation speed, range, and use in programming languages. Detailed introduction: 1. The precision is different. Float is a single-precision floating point number, occupying 4 bytes (32 bits), while double is a double-precision floating point number, occupying 8 bytes (64 bits); 2. The storage and calculation speed are different. , double takes up more space and requires more storage space to store values. In applications that require high performance and speed, it may be more efficient to use the float type; 3. Different ranges, etc.

How many bytes does double occupy? How many bytes does double occupy? Dec 25, 2020 am 10:36 AM

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

Interpretation of Java documentation: Analysis of the function of the valueOf() method of the Double class Interpretation of Java documentation: Analysis of the function of the valueOf() method of the Double class Nov 04, 2023 am 10:55 AM

Interpretation of Java documentation: Analysis of the function of the valueOf() method of the Double class, which requires specific code examples. Introduction: In Java development, the conversion and operation of digital types are often involved. The Double class is a wrapper class in Java that provides some practical methods to handle double-precision floating point operations. Among them, the valueOf() method is an important method in the Double class. This article will analyze the function of this method and provide specific code examples to help readers better understand. one,

How to use the isPositiveInfinity() method of the Double class to determine whether a number is positive infinity How to use the isPositiveInfinity() method of the Double class to determine whether a number is positive infinity Jul 24, 2023 pm 07:57 PM

How to use the isPositiveInfinity() method of the Double class to determine whether a number is positive infinity Introduction In Java programming, we often need to make some judgments and processes on numerical values. Sometimes we need to determine whether a number is positive infinity. Java's Double class provides an isPositiveInfinity() method, which can be used to determine whether a number is positive infinity. This article will introduce how to use this method and some related considerations. Do

Java Iterator vs. Iterable: Improve your understanding of Java collections Java Iterator vs. Iterable: Improve your understanding of Java collections Feb 19, 2024 pm 06:20 PM

Sets can be divided into two categories: ordered sets and unordered sets. The data items in an ordered set are arranged in a certain order, while the data items in an unordered set have no fixed order. The Java collection framework provides a rich set of collection classes that can easily store and manage data. Commonly used collection classes in the Java collection framework include: List: list collection, ordered collection, supporting repeated elements. Set: Set, unordered collection, does not support repeated elements. Map: dictionary collection, unordered collection, key-value pair storage. Understand the concepts and types of collections. Master the use of collection classes. Ability to use collection classes to store and manage data. Understand the concepts and types of collections. Master the use of collection classes. Ability to use collection classes to store and manage data. Understand the concept of sets

Interpretation of Java documentation: Functional analysis of compare() method of Double class Interpretation of Java documentation: Functional analysis of compare() method of Double class Nov 04, 2023 pm 12:25 PM

Interpretation of Java documentation: Analysis of the function of the compare() method of the Double class. The Double class is a wrapper class used to represent double-precision floating point numbers (64 bits) in Java. It provides a range of methods for manipulating and comparing numbers. One of the commonly used methods is compare(), which is used to compare the values ​​of two Double objects. This article will provide a detailed analysis of the compare() method of the Double class and provide corresponding code examples to help readers better understand its functions and usage.

How to use the isInfinite() method of the Double class to determine whether a number is infinitesimal How to use the isInfinite() method of the Double class to determine whether a number is infinitesimal Jul 26, 2023 am 11:04 AM

How to use the isInfinite() method of the Double class to determine whether a number is infinitesimal. Infinite small is a concept in mathematics that is used to indicate that a number is close to zero but not equal to zero. In computer programming, we often need to determine whether a number is infinitesimal. Java's Double class provides the isInfinite() method to determine whether a number is infinitesimal. This article will introduce how to use the isInfinite() method of the Double class to determine whether a number is infinitesimal and give