Start here · Essential guide
What double Does in C++
In C and C++, double stores decimal numbers with about 15 significant digits. Learn how to declare, print, read and compare double values safely.
Syntax and Functions
What double stores, how big a float is and how to print floating point values.
Start here · Essential guide
In C and C++, double stores decimal numbers with about 15 significant digits. Learn how to declare, print, read and compare double values safely.
Yes, for printing: printf uses %f for a double. Reading with scanf needs %lf, and mixing them up can give wrong results. Examples are included.
On most common systems a float is 4 bytes with about 6 or 7 significant digits. Learn why the size can vary across compilers and how to check it with sizeof.
Related topics