|
|
Double Precision Floating Point Data Type
|
Tutorials

Cpp

|
Topic |
How is "double" datatype used in C++?.
|
|
Explanation |
|
The "double" precision floating point data type is used to represent floating point numbers that occupies 8 bytes. The range of
values for the "double" datatype is between +/- 1.7e to +/- 308.
Example:
#include <iostream.h>
void main()
{
double a = 1000000.0;
cout << "Double Precision Floating Point is:" << a << '\n';
cout << "Bytes occupied is:" << sizeof(a);
}
|
Result:
Double Precision Floating Point is: 1e+06
Bytes occupied is: 8
In the above example, the value of the double floating point number is displayed along with the bytes occupied by the "double" data type.
|
| Note |
C++ is one of the most used programming languages in the world. Also known as "C with Classes".
Hope you enjoy this tutorial. Do send your feedback or suggestions on this C++ tutorial. This is a copyright content.
|
|
|
|