Re: Unknown symbol

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Jan Hudec wrote:

<snip>

I think this value is written only for remember how it works.
Could you not put it in comments and put the right value as :
#define FREQ_LO 1400000 /* 87.5*16000 */


Was this code compiled with some strange settings? normallyu the
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.

Slight correction - the result would be double. Also a reading of the standard seems to indicate that the casting is not at the
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/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux