Reputation: 39
I want to implement Knuth's Algorithm D for division on C (Link to Knuth's book, p272). In step "D4. [Multiply and subtract.]", it states:
if the result of this step is actually negative, (uj+nuj+n−1 . . . uj )b should be left as the true value plus bn+1, namely as the b’s complement of the true value...
What does this mean? I interpret this as that I'm just able to leave (uj+nuj+n−1 . . . uj )b as it is, even if the result is 'negative' (expressed as the complement, as the datatype is unsigned).
Upvotes: 0
Views: 97