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

Handling Negtive numbers

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
cam_male2003



Joined: 21 Sep 2005
Posts: 12

View user's profile Send private message Yahoo Messenger

Handling Negtive numbers
PostPosted: Fri Oct 20, 2006 10:36 am     Reply with quote

Hi All:

I feel stupid asking this question, how do you handle negitive numbers. I have an if statement the says if(pressure<LoPoint){lo_point_flag=1;} When the pressure is negitive it does not work.. I am sure it simple, but I pulling out the only hair I have left, trying to find the answer... Oh all varables are signed long.

Thanks all

CCS 3.249
Pic18lf2520
jma_1



Joined: 08 Feb 2005
Posts: 147
Location: Wisconsin

View user's profile Send private message

PostPosted: Fri Oct 20, 2006 10:54 am     Reply with quote

Greetings,

If you define your pressure as an int8, int16, or in32 they are by default unsigned. The A/D conversion from a PIC only returns positive values. Without more information I cannot say what the problem is.

Cheers,
JMA
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
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