Why does "float f = 3.5;" generate a compile-time error?

John Zukowski

The constant value 3.5 is recognized by the compiler to be a double rather than a float. You must place an f after the 3.5 for it to be recognized as a floating point constant value:

float f = 3.5f;