I have a little trouble understanding how to write a mathematically notation for r = x%n. How should I write this in math notation if I want to get the remainder value, after dividing by $n$? $r$ is also not just an integer in this case, just the rest of $x$ (double) divided by $n$ (integer), "$r = \operatorname{mod}(5.4, 3) = 2.4$" in this case. I think $x \equiv r \mod n$ means something different.
Edit: After thinking a while, I am still confused by the notation. Why is the notation $x \equiv r \mod n$ used at all? If $\operatorname{mod}$ is a mathematical operator like $\sin$ or $\cos$, why is the notation $r = \operatorname{mod}(x,n)$ not used always?