Home >Backend Development >C#.Net Tutorial >What does double mean in C language?
#What does double mean in C language?
The meaning of double in C language is:
Double is a keyword in C language, which represents double-precision floating point type and occupies 8 bytes of memory space. Its numerical value The range is "1.7E-308 ~ 1.7E 308". The number of valid figures fully guaranteed for double precision is 15 digits, and 16 digits are only guaranteed for some values.
The difference between double and float
In C language, both float and double are floating point numbers. The difference is: the range represented by double, the range of the integer part is larger than that of float, and the precision of the decimal part is also higher than that of float.
For example: If the number pi 3.1415926535 is expressed as a float, it can only be accurate to 6 decimal places at most. And double can be accurate to about 15 decimal places. The exact number depends on the compiler used, but there is not much difference between editors and compilers.
As for the integer part, the range of the integer part represented by float is large enough, and can be expressed to the trillions level, which is so large that it is boundless. The range of integers represented by double is so large that it has no edge. In actual development, except for a few high-precision fields, basically using float is enough.
Recommended tutorial: "PHP Tutorial"
The above is the detailed content of What does double mean in C language?. For more information, please follow other related articles on the PHP Chinese website!