It can in Math, but I came across this when I was looking into Rabin-Carp string searching algorithm. The hash function they used (source: wikipedia: https://en.wikipedia.org/wiki/Rabin%E2%80%93Karp_algorithm#Hash_function_used) was this:
[(104 × 256 ) % 101 + 105] % 101 = 65
How is this better than deleting the inner mod operator so you only have one on the outside? As so:
[104 × 256 + 105] % 101
As far as I can tell it should give the same result, and mods are generally expensive operations, so wouldn't it be better to have one?
The only thing I can think of is concerns about overflow, but if that were the case, the multiplication would be similarly split up, like so:
(104 % 101 × 256 % 101 ) % 101 + 105] % 101 = 65