How does (r-1) complement for subtraction work? My instructor gave an algorithm for doing subtraction with (r-1)'s complement. For subtracting M - N, it goes like the following.

1) Find the (r-1)'s complement of N by using formula r^n - r^m - N. n is the number of non-fractionated digits and the m represent the number of digits after the radix point. For instance, if N = 324.16 in decimal, the formula would 10^3 - 10^-2 - 324.16

2) Next, Add the M to N's complement. If there is an end around carry, add it to the least significant digit. Else, take the r-1's complement of the sum.

The algorithm works but I just don't understand how it works. Can someone explain ? Thanks !
subtraction using complement is something like comparing two values indirectly using some standard third value(r's or r-1's complement). suppose there are two straight lines on paper and we want to fined difference in length between them then we draw third line greater then both of previous lines and compare both of these lines with third one and then easily find difference between them without comparing them directly.
subtraction using complement is something like comparing two values indirectly using some standard third value(r's or r-1's complement). suppose there are two straight lines on paper and we want to fined difference in length between them then we draw third line greater then both of previous lines and compare both of these lines with third one and then easily find difference between them without comparing them directly.