double Double-precision floating-point type

double Double-precision floating-point type

double has at least float's precision and range. Unsuffixed literals are double; 64-bit IEEE 754 is common. Approximation complicates monetary calculation.

CategoryType specifiers
KindKeyword / Statement
C standardC89 / C90

📝 Syntax

double d = 3.14159265358979;

▶ Example

Edit the C code below and click Run; the server compiles and executes it:

Output:

circumference = 6.28318

📚 Related Tutorials

❓ FAQ

QCan double represent 0.1 exactly?
ANot in common binary floating-point implementations; it stores only a nearby value. Greater precision does not make every decimal fraction exact. Financial calculations should use a suitable decimal or integer fixed-point approach.
QIs double fixed at 64 bits by the C standard?
ANo. The standard only requires precision and range at least equal to float's. Sixty-four-bit IEEE 754 double precision is common, but portable code should not treat that layout as a network or file format.
QWhat type is an unsuffixed floating-point literal?
ALiterals such as 1.25 and 1e3 have type double. An f or F suffix produces float, while l or L produces long double. The suffix determines the literal's type, not whether its decimal value is exact.
Web-Tutorial.com

Web-Tutorial Tech Team

A team of developers maintaining programming tutorials. Each tutorial is written and reviewed by developers with expertise in that field. We work to keep our content accurate and reliable — if you spot an issue, please let us know.

Content reviewed by MOTO · Found an error? Report it

100%

🙏 帮我们做得更好

我们是刚上线的编程教程站,几个人的小团队,精力有限。页面虽经检查,难免还有疏漏——链接失效、排版错乱、内容有误、语言生硬……

如果您发现了,麻烦告诉我们,我们会在收到反馈后第一时间进行修复,再次感谢您的光临 🙏