<snip>
Slight correction - the result would be double. Also a reading of the standard seems to indicate that the casting is not at theI think this value is written only for remember how it works.Was this code compiled with some strange settings? normallyu the
Could you not put it in comments and put the right value as :
#define FREQ_LO 1400000 /* 87.5*16000 */
compiler would have evaluated the expression and not generated code to
calculate the value...
No. But the result would be float. So another operation later could be computed in floating point. And if the result is integer, it's at compilers discretion to compute as float and then cast or cast and compute as integer. It seems to have chosen the first option.
discretion of the compiler - the other operand being double, it is mandated that the integer operand be converted to double, the result
also being of the latter type.
-Trevor
-- Kernelnewbies: Help each other learn about the Linux kernel. Archive: http://mail.nl.linux.org/kernelnewbies/ FAQ: http://kernelnewbies.org/faq/