Question: how to make an assignment and display its expression and its value on same line?

March 06 2014 nm 465

3

I'd like to bind a symbol to some expression, but display the expression analytically before evaluating, and show the value on the same line (not new line).

Something like:

restart;
a:=10: b:=3:
f:='a+b^2';`=`,f;

But this display the expression and its numerical value on 2 lines. I'd like to get this output:

      f:=a+b^2 ,`=`,19  

This is just so I can see the expression before it is evaluated, and its numerical value on same line. Or if there is a better way do this. I tried using print, but could not get the assignment to work then.

 

Please Wait...