MathGroup Archive 2009

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

Search the Archive

Re: More /.{I->-1} craziness

  • To: mathgroup at smc.vnet.net
  • Subject: [mg106043] Re: More /.{I->-1} craziness
  • From: dh <dh at metrohm.com>
  • Date: Thu, 31 Dec 2009 03:15:11 -0500 (EST)
  • References: <hhf5s3$h4o$1@smc.vnet.net>

Hi,
no magic here, the pattern matcher is working on the full form, not
the displayed one. You can see the full form using: "FullForm".
The full form of -I is: Complex[0,-1] and that of I: Complex[0,1].
This explains why I does not match -I.
I do not see a problem with E and Pi.
For Infinity the full form is:DirectedInfinity[1] and for -Infinity:
DirectedInfinity[-1].
Daniel


On 30 Dez., 10:17, AES <sieg... 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.)



  • Prev by Date: Re: define a function with variable coefficients
  • Next by Date: Re: More /.{I->-1} craziness
  • Previous by thread: Wrapping Begin["Context`"], ..., End[] into a function
  • Next by thread: Re: More /.{I->-1} craziness