I would like to compare variables t and u and print either Yes or No depending one which is larger.
My code is simply the following:
Assuming[t < u, If[t - u < 0, Print[Yes], Print[No]]]
Since t < u is assumed, t - u < 0 holds. So I should get Yes. But what I get is a repetition of If term. That is,
If[t - u < 0, Print[Yes], Print[No]]
Am I missing something?
Simplify(Assuming[t < u, Simplify[If[t - u < 0, Print[Yes], Print[No]]]]) otherwise theAssumpitionhas no effect. – Karsten7 Sep 06 '14 at 18:07Ifhas noAssumptionsoption. – Karsten7 Sep 06 '14 at 18:08Ifhas noAssumptionsoptions, so I have to always useSimplify.... Thank you so much! – ppp Sep 06 '14 at 18:11Assumingonly has an effect on an expression, if the expression has the optionAssumptions, likeSimplifyhas. – Karsten7 Sep 06 '14 at 18:11