problem in arithmetic subtraction

Thread Starter

annujain501

Joined Jul 28, 2010
6
if two n-digit unsigned numbers are subtracted,then,
for M-N (both in base-r)

M-N=M+r's complement of N

but if we have one n-digit number and other n-1 digit number,this method doesnt work. how it can be done then ? for eg;

(both 46 and 7 are in base-8)

46
-7
 

Papabravo

Joined Feb 24, 2006
21,225
You borrow a 1 from the 4 in the 8's place.
so 16 - 7 = 7
then 3 - 0 = 3
and the result is 37 base 8

This is EXACTLY the same process you would use doing subtraction in base 10 representation.
 
Top