Let's say I need to divide two integers $x$ and $y$, but I only care about the lowest 8 bits of the answer, i.e. I'm calculating:
$$r = \frac{x}{y}\,\,\%\,\,256$$where % is the modulus operator.
Is there a way to short-cut the answer rather than having to do the full division-calculation?
Update:
I'm entirely working with integer variables on a computer, so the result is rounded down to an integer as well. So, for example for $x=18423$ and $y=29$: $$r=\frac{18423}{29}\,\,\%\,\,256=635\,\,\%\,\,256=123$$