This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

floating point

Hi every body

I don't know why I don't have the float
part of the temp var.


float temp;
int H_Value;
int L_Value;
int value = 55;

temp = value / 10;
H_Value = (int)temp;
L_Value = (int)(temp - H_value)*10;


the value int temp is 5 and not 5.5

Thanks Kobi

Parents
  • And note that this is all standard 'C' - nothing specifically to do with Keil.

    Therefore, in this case, reading the Keil Manual will not help you - because the Keil manual assumes that you already know ANSI 'C', so only goes into the implementation-specific details.

    You will need to refer to K&R, or another good 'C' textbook.

Reply
  • And note that this is all standard 'C' - nothing specifically to do with Keil.

    Therefore, in this case, reading the Keil Manual will not help you - because the Keil manual assumes that you already know ANSI 'C', so only goes into the implementation-specific details.

    You will need to refer to K&R, or another good 'C' textbook.

Children
No data