Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - How to store real numbers in double bytes, and how to arrange integer parts and decimal parts in double words?
How to store real numbers in double bytes, and how to arrange integer parts and decimal parts in double words?
When learning C language, real numbers are divided into integer (int) and floating-point number (double) in the computer.

Floating-point storage data: significant number+power number

For example: 1.234× 10?

The previous byte stores 1.234.

The last byte stores the (+3) power of 10, that is, stores (+3).

After a long time, the computer seems to be binary storage. Let me make an analogy here.

integer

Both bytes are valid numbers.

finally

1, the integer is stored as an integer, and it is stored as "plastic data".

2. Decimals are stored according to "floating point type" (scientific counting method).

3. The storage of integer+decimal point is the same as (2).