r/AskComputerScience • u/Successful_Box_1007 • Jun 21 '25
why does turning subtraction into addition using 10s complement work for 17-9 but not for 9-17 ? In the former the least significant digits match ( because we have 8 and 18) but in the latter they don’t ( we have -8 and 92)
Hi everyone, hoping someone can help me out if they have time:
why does turning subtraction into addition using 10s complement work for 17-9 but not for 9-17 ? In the former the least significant digits match ( because we have 8 and 18) but in the latter they don’t ( we have -8 and 92).
Where did I go wrong? Is 92 (from 100 - 17 = 83 then 83 + 9 = 92) not the 10s complement of 17 ?
Thanks so much!!
1
Upvotes
View all comments
Show parent comment
1
u/Successful_Box_1007 Jun 23 '25
Well what doesn’t seem to work is being able to turn subtraction into addition and then subtract 10 - that only works for bigger minus smaller. I’m reading your other reply now also!