The base -r expansion of a number can be found by repeated division by (-r),recording the non-negative remainders of
and concatenating those remainders, starting with the last. Note that if
remainder d, then
For example, in negaternary:
NOTE: remember to subtract the smaller number, e.g. -3*2 = -6 from -5 and not -3*1 = -3 from -5 as -3 > -5.
No comments:
Post a Comment