Re: More /.{I->-1} craziness
- To: mathgroup at smc.vnet.net
- Subject: [mg106032] Re: [mg106017] More /.{I->-1} craziness
- From: Bob Hanlon <hanlonr at cox.net>
- Date: Thu, 31 Dec 2009 03:13:04 -0500 (EST)
- Reply-to: hanlonr at cox.net
You appear to be comparing apples and oranges.
Head /@ {I, E, Pi, Infinity}
{Complex,Symbol,Symbol,DirectedInfinity}
FullForm /@ {I, E, Pi, Infinity}
{Complex[0,1],E,Pi,DirectedInfinity[1]}
Since rules are applied to the FullForm,,,
Bob Hanlon
---- AES <siegman at stanford.edu> wrote:
=============
The more I play with these I->-I substitution rules, the more seemingly
wildly inconsistent results emerge. For example:
In[1]:= -I/.I->-I
Out[1]= -I
In[3]:= -E/.E->-E
Out[3]= << The Esc e e Esc symbol >>
In[4]:= -Pi/.Pi->-Pi
Out[4]= \[Pi]
In[5]:= -Infinity/.Infinity->-Infinity
Out[5]= -\[Infinity]
(In/Out[2] is removed because it was an irrelevant cell.)