by nahin bin kaysar 28/08/2025 @ 11:49pm
We have modulo operator (%) in every programming languages. This gets the remainder after a division operations.
5 % 2 is 1 => Dividing 5 by 2 will produce remainder as 1 We can also write it as, 5 mod 2 4 % 2 is 0 => 4 is divisible by 2 and will not produce any remainder Same as, 4 mod 2
But here is the bane of my existence: the Congruence son of a bitch I mean % operator works great. But people had to come up with something stupid and confusing as hell. But I will make your life easy.
This is the way to write this shit. Notice that three lines instead of an equal sign? And the location of parentheses? Yeah.
This means a and b will have the same remainder when divided by m
5 ≡ 7 (mod 2) => this means, both 5 and 7 will have the same remainder (it is 1) when divided by 2.
13 ≡ 28 (mod 5) => both 13 and 28 have remainder 3 when we divide them by 5.