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 theAssumpition
has no effect. $\endgroup$If
has noAssumptions
option. $\endgroup$Assuming
only has an effect on an expression, if the expression has the optionAssumptions
, likeSimplify
has. $\endgroup$