21
I try to keep my constants type-consistent. 0 for ints. 0.0f or 0.f for float, and 0.0 for double.
To me, the most important reason to do this is so the compiler and the programmer see the same thing.
If I do this...
float t=0.5f;
float r;
r= 1 * t;
...should r be assigned 0 or .5? There's no hesitation if I do this instead...
float t=0.5f;
float r;
r= 1.0f * t;