Why use a double or floating literal when you need an integer value and the integer literal will be implicitly added to double / float? And when a fractional value is required, why do I need to add f(to make a literal with a floating point), where double will be added to the float?
For example, I often see code similar to the following
float foo = 3.0f;
double bar = 5.0;
double baz = 7.0f;
and
void quux(float foo) {
...
}
...
quux(7.0f);
But as far as I can tell, they are equivalent
float foo = 3;
double bar = 5;
double baz = 7;
quux(9);
I can understand the method call if you are in a language with overload (C ++, java), where it can actually make a functional difference if the function is overloaded (or will be in the future), but I'm more interested in C (and to a lesser extent Objective-C), which has no overload.
/ f? , ?