Re: Rule replacement doesn't work after NDSolve?
- To: mathgroup at smc.vnet.net
- Subject: [mg124068] Re: Rule replacement doesn't work after NDSolve?
- From: Bill Rowe <readnews at sbcglobal.net>
- Date: Sat, 7 Jan 2012 05:26:03 -0500 (EST)
- Delivered-to: email@example.com
On 1/6/12 at 4:18 AM, g.crlsn at gmail.com (gac) wrote: >I see that the FullForm[-2*I] is also not >Times[Complex[-2,0],Complex[0,1]]. >So this won't work either: >-2*I/.Complex[0,1]->Complex[0,-1] >to replace only I with -I, we need to use parentheses: >-2*(I/.I->-I) No, it is not necessary to use parentheses. This works: In:= 2 I /. Complex[_, a_] -> -a I Out= -2 I