Hello Can any body tell me how to use floating point datatype for programming in C in kiel. i have defined in the following way float i= 19.5; or float j= 18.2/255; but these are given as errors. please tell me how to use floating point datatype for Keil. Thanking you
The right hand side of this line only contains constants: unsigned char k = 255*(1- (float)18/0xb6) so the compiler evaluates it for you. This line has a variable on the right hand side: unsigned char k= 255*(1-(float)18/j) so it has to be evaluated at runtime, which you can't do with the evaluation version.