5
$\begingroup$

That is real numbers modulo an integer. I'm just interested in shuffling around +-*/ operations.

If a concrete example helps here's my current problem. (I'm from a programming background so there's probably a notation disconnect, sorry about that.)

LI(x) = (LI0 + x / PI) % 1

LF(x) = (LF0 + x / PF) % 1

LI(s) + 0.5 = LF(f)

f = s + PT / 2

I need to find a solution for s, given LI0, LF0, PI, PF and PT.

Also I think I might have a solution by dropping the %1's, solving for s and then modding that by:

1 / abs(1 / PI - 1 / PF)

But I can't tell if that actually works because it introduces an enormous rounding error.

Also while this is the problem at hand and solving it is my immediate goal, I really want to understand how to generate that solution, for next time.

  • 0
    You can't do modular arithmetic with real numbers. (Actually, you can't even do modular arithmetic with rational numbers.) All you're doing is taking the remainder after some division operation.2011-08-03
  • 5
    well, the reals is an abelian group and contains the integers, so we can certainly mod out by any multiple of the integers.2011-08-03
  • 7
    @Tobias: But that only works if you restrict yourself to addition. As soon as you start multiplying, you run into problems because the integers don't form an *ideal* of the real numbers.2011-08-03
  • 2
    Working "modulo 1" is equivalent to working with the [fractional part function](http://en.wikipedia.org/wiki/Fractional_part_function), which is defined as $\{x\}=x-\lfloor x\rfloor$. Perhaps those magic words will give you the push you need.2011-08-03

2 Answers 2