The % operator is mathematically correct, but not pragmatically. In practice you want positive numbers (array indices and such). So while -1 % 8 is equal to 7 % 8 is equal to 15 % 8, the second result is much more useful to me. As for the concept of a 'wrapper' function, it seems to me you just haven't heard the vocabulary term before, because the concept is startlingly simple. "Wrap", ie to place something around something else... your own interface around another for example. |