I have been writing a program these two days, read some articles, and turn to notes. The original Article address is:
Http://topic.csdn.net/u/20090716/10/ce4a7037-3c0d-40ae-af85-f702c78fcea3.html
A single-precision floating point occupies 4 bytes and is described in 32-bit binary format. The double-precision floating point occupies 8 bytes and is described in 64-bit binary format. Floating Point Numbers are expressed in exponential form on the machine. They are divided into four parts: digit, tail, exponent, and exponent. The digit occupies 1 binary, indicating positive and negative numbers. The exponent occupies 1 binary, indicating the positive and negative of the index. The ending number indicates the valid number of the floating point number, 0. xxxxxxx, but the start 0 and the vertex are not saved. Valid Number of the index storage index. The number of digits in the index and the number of digits in the tail are determined by the computer system. It may be that the digit plus the ending number occupies 24 places, and the exponent plus the index occupies 8 places-float. The digit plus the ending number occupies 48 places, and the exponent plus the index occupies 16 places -- double. After knowing the placeholder values of these four parts, we estimate the size range in binary format and convert it to decimal format, which is the value range you want to know. For programmers, the difference between double and float is that double has a high precision, 16 digits are valid, and float has a precision of 7 digits. However, double consumes two times the memory usage of float, and the double operation speed is much slower than float. in C language, the mathematical function names double and float are different. Do not write an error, do not use dual-precision when using single-precision (saves memory to speed up the operation ). |
The Long Double Standard specifies that it is 128-bit floating point data, while the double value is 64-bit floating point data, but the compiler is also different. For example, in VC, they are all 64-bit. In short, long double> = Double = 64-bit is not wrong.