QP School

Full Version: Double datatype in C
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Description:

The double data type in C is used to store double-precision floating-point numbers. It typically occupies 8 bytes of memory and offers higher precision compared to the float data type. Double-precision floating-point numbers can represent a broader range of real numbers with greater accuracy.

Example:

double pi = 3.14159265359;

Explanation:

In this example, we declare a variable pi of type double.
We initialize it with the value 3.14159265359.
The double data type provides higher precision than float and can represent real numbers with a range of approximately ±1.8E+308 and typically has 15 to 17 significant decimal digits of precision.