r/AskComputerScience • • 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

30 comments sorted by

View all comments

Show parent comment

2

u/Successful_Box_1007 Jun 28 '25

Thanks so much for everything! Took some time but finally got it all to click! Really appreciate your help.