I know that the suffix of a floating point number with f allows the compiler to know that it is a float, not a double. This is important to prevent unnecessary casting when working on floats, rather than two-floats. However, in some code I was provided by an external company, I saw, for example, the following:
double i = 1.4f;
Now, what interests me is what happens in this case? Will the compiler silently ignore "f", and this is just something that has nothing to do with anything, and I can safely ignore it?
Then I thought that if numbers are assigned to doubles with the suffix f in a different place, and not just during initialization, will this be a different case that acts differently?
source share