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

  • To: mathgroup at smc.vnet.net
  • Subject: [mg61423] Re: [mg61397] Re: (a/b)^2 when a/b is replaced by e won't yield e^2
  • From: Andrzej Kozlowski <akoz at mimuw.edu.pl>
  • Date: Wed, 19 Oct 2005 02:16:03 -0400 (EDT)
  • References: <dinvoj$s6i$1@smc.vnet.net><200510150223.WAA17341@smc.vnet.net> <diskhc$m7i$1@smc.vnet.net> <200510180644.CAA11192@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

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