I used debug option of my simulator in order to check the values, and my code works just fine when I exclude the float variables. I think I should do a lot of reading about float numbers in ccs c. Thank you all for support!
Mike Walne
Joined: 19 Feb 2004 Posts: 1785 Location: Boston Spa UK
divide floats
Posted: Wed Feb 01, 2012 2:27 pm
Quote:
I want to ask another thing. Is there a problem if I compare int and float values???
You could have answered this one for yourself with a simple short test.
When I tried, with different compilers, I got some totally wrong results. The compilers did not always convert the int to float before doing the compare! Like Ttelmah says, stick with integers if you can, or do the cast yourself to be certain that the compiler does not miss it.
All times are GMT - 6 Hours Goto page Previous1, 2
Page 2 of 2
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum