Original Post
hey guys..I'm looking for a simple algorithm to do the following: on in : ofs can be any int, block can be any int on out : ofs must be in the range (0..31) if ofs is -32..-1 block will be decremented by one and ofs will have 32 added to it (to get it in the range of 0..31) if ofs is -64..-33 block will be decremented by 2 and ofs will have 64 added to it..etc.. if ofs is >= 32 block will have ofs / 32 added to it and ofs will be ofs % 32.. I'm looking for a simple couple line solution.. I have it working now but it does alot of operations and I'd like to condense it if at all possible..thanks in advance -- Bradd [Edited by - bradbobak on September 12, 2005 12:47:13 PM]