Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there any way to find $\lfloor xy\rfloor$ mod $m$ if $x$ is something large (like a big factorial where it is normal to calculate it stepwise, taking the modulus each step) and $y$ is irrational?

It does not appear that $\lfloor$(($x$ mod $m$) times $y$)$\rfloor$ mod $m$ is the same as $\lfloor$($x$ times $y$)$\rfloor$ mod $m$ even if it may work for integers.

share|cite|improve this question
this might help, at least for a lack luster answer, think about x being $10^{10}$. Then the value of this would be $y$ to the first 10 decimal places. It really seems to depend on $x$ – DanZimm May 9 '13 at 2:45

$\lfloor xy\rfloor \pmod{m}=\lfloor \left(x \pmod{\frac{m}{y}}\right)y\rfloor \pmod{m}$. You may subtract as many integer multiples of $\frac my$ as you want from $x$ without changing the final result.

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.