# Can a modulo function be linearized or alternatively expressed?

In order to try to simplify or alternatively express cryptographic functions I wonder if the modulo function can be alternatively expressed. Could for example a Fourier series of a sawtooth wave or its discretization be useful? What would that look like for a given range and precision?

• When the modulus is a power of two, $x\bmod n$ reduces to $x\&(n-1)$, where $\&$ is bitwise AND. That generalizes to $n$ of the form $b^k$, by expressing $x$ in base $b$ and keeping the $k$ low-order digits. That applies to any $n$ by expressing $x$ in base $n$, but is not much useful.
– fgrieu
Commented Jun 3, 2022 at 9:47
• do you mean the function $x \mapsto x \pmod n,$ for some $n$? If yes, the above comment answers it. Commented Jun 3, 2022 at 11:44
• how you approximate it also depends on the application, there is a paper eprint.iacr.org/2021/572.pdf that approximates the mod function based on sine series but it needs to use complex number arithmetic Commented Jun 8, 2022 at 8:36