Do you have a question? Post it now! No Registration Necessary
- Posted on
- two's compliment math
February 21, 2006, 8:49 pm
rate this thread
Have been trying to do 32bit signed subtraction using two's compliment but I
can't seem to get correct figures if either (or both)of the original
operands are negative.
For a simple example in real math, 3 subtract -2 is 5, but the two's
compliment routines say the result is -1.
Am I missing something or is two's compliment unsuitable for mixed sign
The routines are public domain and work precisely for two positive operands
so it appears the routines are working correctly.
Do I need to go to another form of subtraction(fixed/floating point)?
What I really want is to find a quick way to find the difference between two
32bit signed numbers.
- » Finding a comprehensive parametric contoller directory
- — Next thread in » Microcontroller Discussions
- » Owncloud cannot be installed on Raspbian 10 (buster)
- — The site's Newest Thread. Posted in » Raspberry Pi Group