What is the significance of 0.0f when initializing (in C)?

float x = 0 has an implicit typecast from int to float.
float x = 0.0f does not have such a typecast.
float x = 0.0 has an implicit typecast from double to float.

Depending on the compiler, implicit typecast can require the compiler to generate extra code.

Leave a Comment