I\'m sure this is fairly simple, however I have a major mental block on it, so I need a little help here!
In my program, I am using BitArrays to represent 160 bit numbers. I want to be able to add, subtract, increment and decrement these numbers, wha开发者_高级运维t is the algorithm for doing this?
In the google protocol buffers encoding overview, they introduce something called \"Zig Zag Encoding\", this takes signed numbers, which have a small magnitude, and creates a series of unsigned number