This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

labs function

There a two unsigned integers.
Lets call them red and blue.
How can i put them in a if condition?

The if condition should be true, if the difference between the two (unsigned integer) variables is greater than a constant value?

I assume i should use the labs function in such way:

   if (labs((signed int)red - (signed int)blue) > 22){
   // doing something if condition is true :-)
   }


is there a better way to do?

In which library is the labs function?
Thanks in advance for being patient ;-)

0