C: why decimals considered double by default ?

Can anybody tell me why any literal constant real numbers are double by default in C ? Why is the default not float ?

Originally C had almost no float support at all. Arithmetic was done in double, arguments to function were double, etc. When you used a float it was "promoted" to a double. It was like an object n that was a float was treated as "(double) n" except as an lvalue. So you could store data as float in an array or struct to save space, but it doubled when you used it. I'm not sure what the motivation was especially since I came from a Fortran environment. I heard some expanations (excuses?), but Fortran faced the same issues and made multiple precisions available anyway. Much of this changed when Ansi-C was introduced. But constants stayed double by default to save existing code. The Ansi comittee wanted to avoid breaking code where they could.

Look at your compiler's docs. You may have an option to make your constants floats.

It's safer to assume high precision than low precision. C will freely downconvert to float when you actually ask it to, so this behavior usually doesn't cause problems.