1
$\begingroup$

For example I have tried:

Floor[Mod[H, p1*p2*p3]/(p1*p2*p3)]/.{Floor[Mod[H, x_]/(x_)]->0}

and

Floor[Mod[H, p1*p2*p3]/(p1*p2*p3)]/.{Floor[Mod[H, x__]/(x__)]->0}

but they not does work except for the case where the product is just p1. The number of elements in these products will vary from p1 to p1*p2*...*pm.

$\endgroup$

1 Answer 1

0
$\begingroup$

The thing to keep in mind is that / is translated into Times and Power, which one can see in the FullForm:

Floor[Mod[H, p1*p2*p3]/(p1*p2*p3)] // FullForm
(*
  Floor[Times[Power[p1, -1], Power[p2, -1], Power[p3, -1],  Mod[H, Times[p1, p2, p3]]]]
*)

So to match the denominator with the argument of Mod takes something like this:

Floor[Mod[H, p1*p2*p3]/(p1*p2*p3)] /. {Floor[
    Mod[H, x_] * y__ /; 1/Times[y] === x] -> 0}
(*  0  *)
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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