0
$\begingroup$

I have an equation that looks like:

$$\frac{(x \pmod a) - (x \pmod b)}{b}$$

is there any way to simplify this further?

$\endgroup$
2
  • $\begingroup$ Probably not. What were you thinking? $\endgroup$ Commented Jun 11, 2020 at 14:44
  • $\begingroup$ In what set are the operations subtraction and division carried out? $\endgroup$
    – MasB
    Commented Jun 11, 2020 at 16:06

1 Answer 1

0
$\begingroup$

Well, using $a \pmod{b}=a-b\lfloor\frac{a}{b}\rfloor$, we can simplify it to $$\frac{1}{b}\left(b\left\lfloor\frac{x}{b}\right\rfloor-a\left\lfloor\frac{x}{a}\right\rfloor\right)$$ See if you can simplify it further by investigating the floor function.

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .