Return equality from Mathematica function

后端 未结 4 1167
小蘑菇
小蘑菇 2021-01-23 16:51

I have a function that returns equalities, which I want to print, for example, x==y, or 2x+5==10. These usually have no meaning for mathematica, it cannot simplify it furhter.

4条回答
  •  余生分开走
    2021-01-23 17:07

    You can use Defer to do this:

    In[5]:= printableEqual[x_, y_] := Defer[x == y];
    In[6]:= printableEqual[1, 2]
    Out[6]= 1 == 2
    

提交回复
热议问题