in reply to Re^2: Modulo of fraction?
in thread Modulo of fraction?

... although taking the modulus of something (mod pi) seems pretty weird ...
Not only weird but for such transcendental numbers as pi or e I can imagine that the result is undefined!

CountZero

"If you have four groups working on a compiler, you'll get a 4-pass compiler." - Conway's Law

Replies are listed 'Best First'.
Re^4: Modulo of fraction?
by kaif (Friar) on Jun 28, 2005 at 14:50 UTC

    On the contrary, mathematics makes use of "modulo 2π" (that's "2 pi") somewhat often. In particular, in discussing Fourier series, you consider functions defined on the circle, which is often thought of as the reals R modulo 2π. Most of the suggested fraction modulus functions here do the right thing.

    The "niceness" of integer moduli is that the following is true: (($a % $m) + ($b % $m)) % $m == ($a + $b) % $m and (($a % $m) * ($b % $m)) % $m == ($a * $b) % $m. However, even for non-integer moduli, the former is true.