Yesterday I wrote a short program which caused me to have even more
questions after I finished than I did when I started.
int
main(void)
{
long longint1 = 11L,
longint2 = 3L,
result1,
result2;
float multiplier = 1.12345F;
result1 = longint1 * longint2 * multiplier; /* 37 */
result2 = longint1 * longint2 * multiplier + 0.9999F; /* 38 */
return(0);
}
Can someone explain to me just which variables were implicitly cast by
the compiler (I used MSVC 5.0)? Would result2 have been different had
I placed a left paren following the '=' and a right paren before the
'+'? Was it necessary to place 'F' in each of the two places used
(after the constants to which they referred)?
* KWQ/2 1.2i *
--- FLAME v1.1
---------------
* Origin: Port Chicago's Loading Dock - 510-676-5359 (1:161/204)
|