0 Replies Latest reply on Oct 15, 2010 9:52 AM by robert.seczkowski

    How to get good signed result?

    robert.seczkowski

      int hdata,hdataprev;
      char factor = 0x03
      if(hdata > (hdataprev + (int)factor)){
      do A
      }else{
      do B
      }
      if hdata is like 0xFF0A and hdataprev like 0xFF00 , then everything is OK - code A is executed
      BUT
      when hdata is 0x00AA and hdataprev like above(0xFF00) then code B is executed instead of code A (Positive 0x00AA is greater than negative 0xFF00).
      Isn't it?
      Robert