Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Modulo of fraction?

by Old_Gray_Bear (Bishop)
on Jun 27, 2005 at 16:37 UTC ( [id://470327]=note: print w/replies, xml ) Need Help??


in reply to Modulo of fraction?

I believe that modulo arithmetic is only defined for intergers. See the Wolfram MathWorld discussion of 'Congruence'(http://mathworld.wolfram.com/Congruence.html). Note: 'fractional congruence' is discussed in the final paragraphs of the article, as the solutions of a 'linear congruence equation'.

----
I Go Back to Sleep, Now.

OGB

Replies are listed 'Best First'.
Re^2: Modulo of fraction?
by shemp (Deacon) on Jun 27, 2005 at 23:45 UTC
    This becomes a battle of semantics. Mostly one only sees modulo arithmetic defined for integers, where the modulus needs to be a positive integer. But there are definely analogous systems that deal with fractions, and i suppose that they can be extended to reals, although taking the modulus of something (mod pi) seems pretty weird to me.

    But as a mathematician, as long as the system definition is consistent, there shouldnt be any problem.

    I do recall in an old (1950's) number theory book that got from a clearance rack (old crap free for the taking) from my universities math department (which i still posess), it is left as an exercise to extend modular arithmetic to include fractions. Ouch!, but such things are feasible.

    I should read the link you cited, but am way too busy right now.

      ... 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

        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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://470327]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (5)
As of 2024-03-28 14:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found