CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

problem with dividing 2 float numbers
Goto page Previous  1, 2
 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
cenar



Joined: 31 Jan 2012
Posts: 7

View user's profile Send private message

PostPosted: Tue Jan 31, 2012 4:59 pm     Reply with quote

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

View user's profile Send private message

divide floats
PostPosted: Wed Feb 01, 2012 2:27 pm     Reply with quote

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.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
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


Powered by phpBB © 2001, 2005 phpBB Group