Paraphrasing from in "Programming Pearls" book (about c language on older machines, since book is from the late 90's):
Integer arithmetic operations (
*) can take around 10 nano seconds whereas the
% operator takes up to 100 nano seconds.
- Why there is that much difference?
- How does a modulus operator work internally?
- Is it same as division (
/) in terms of time?