Representation: amount * limit + offset, where the result of amount * limit + offset cannot be directly accessed.

Code:

(((amount * (limit % radix)) % radix) + (offset % radix)) % radix

is how to do modulo on representation amount * limit + offset without directly accessing amount * limit + offset.

amount is the amount of limit you have, offset is a number >= 0 and <= limit. Offset, amount and limit are whole numbers.

Division i cannot figure out, please help me(not to just dump everything on you, but i am unable to figure it out).