Besides the optimised versions of these functions, I learned the most from these comments: *The DivMod should be faster. Should really be a single division. The CPU instruction will give you both div and mod from a single instruction. No point doing the divide twice. ...
More...