MathGroup Archive 2005

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

Search the Archive

Re: Re: (a/b)^2 when a/b is replaced by e won't yield e^2


On 18 Oct 2005, at 15:44, mike_in_england2000 at yahoo.co.uk wrote:

>> HoldForm[(a/b)^2] /. (a/b) -> e
>>
>
>
>> HTH
>>
>
>
>> Mike
>>
>
>
>>> If you want to do it this way it is better to use Unevaluated rather
>>> than HoldForm:
>>>
>
>
>>> Unevaluated[(a/b)^2] /. (a/b) -> e
>>>
>
>
>> Andrzej Kozlowski
>> Tokyo, Japan
>>
>
> Hi Andrzej
>
> Thanks for the reply - I didn't know about the Unevaluated command  -
> why is it better to use it rather than HoldForm?  I am not disputing
> what you say - I just would like to understand.
>
> Thanks
>
> Mike
>
>


Because it is immediately stripped off, so you do not need to use  
ReleaseHold to actually use it as input. Look at the outputs in  
InputForm:

In[9]:=
HoldForm[(a/b)^2] /. a/b -> e

Out[9]=
HoldForm[e^2]

In[10]:=
Unevaluated[(a/b)^2] /. a/b -> e

Out[10]=
e^2


Andrzej Kozlowski
Tokyo, Japan




  • Prev by Date: Re: NestList
  • Next by Date: Re: Help with a function to return the 'age' of itself
  • Previous by thread: Re: (a/b)^2 when a/b is replaced by e won't yield e^2
  • Next by thread: Re: (a/b)^2 when a/b is replaced by e won't yield e^2