piclist 1995\12\08\053456a >
Thread: Negative numbers?
picon face BY : Steven Addison email (remove spam text)

I need to check that a value, which will be a slightly variable code value,
is between an upper and a lower threshold (or not).

The way I have thought of doing it is to subtract it from the upper
threshold and retain the result, then subtract the lower threshold from it
and retain that result. If the two results are positive then the code is
within the limits and is good but if either are less than zero then the code
is no good.

       _______________________ upper threshold

               code value

       _______________________ lower threshold

Here is my problem: How do I check for a <0 (negative) value in a PIC register?

Does anybody know? Is it possible? If not what am I going to do?


Desperate Steve.

See also: www.piclist.com/techref/index.htm?key=negative+numbers
Reply You must be a member of the piclist mailing list (not only a www.piclist.com member) to post to the piclist. This form requires JavaScript and a browser/email client that can handle form mailto: posts.
Subject (change) Negative numbers?

month overview.

new search...