MathGroup Archive 2004

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: How to prevent from simplification?



On 27 Nov 2004, at 07:40, Christian Auner wrote:

> How can I substitute values into an expression and prevent it from
> beeing evaluated and simplified?
>
> Assume I have an expression like
>
> a + b/c
>
> and I want to substitute values for a,b and such that the result looks
> like
>
> number + number
>
> That is the evalution stops right before the addition.
>
> I already tried HoldForm but it didn't work.
>
>
>
It is enough to apply HoldForm just to the first summand:

In[2]:=
HoldForm[a] + b/c /. {a -> 1, b -> 6, c -> 3}

Out[2]=
1+2

Andrzej Kozlowski
Chiba, Japan
http://www.akikoz.net/~andrzej/
http://www.mimuw.edu.pl/~akoz/


  • Prev by Date: Re: On constants and D's behaviour
  • Next by Date: Re: How to prevent from simplification?
  • Previous by thread: How to prevent from simplification?
  • Next by thread: Re: How to prevent from simplification?