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.
yeah i am using evaluation software. but i am confused to see this here unsigned char j=0xb6; and if i write unsigned char k = 255*(1- (float)18/0xb6) i am not getting any error and the result is same as what i wanted. but if i use it in the following way , i am getting error. unsigned char k= 255*(1-(float)18/j) where j=0xb6. Is there no other way to perform division operations in evaluation version -Pradeep
Remeber: the free evaluation download does not include floating point http://www.keil.com/demo/limits.htm
but these are given as errors. Exactly what error do you get? Jon
View all questions in Keil forum