MathGroup Archive 2004

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

Search the Archive

A way around the limitations of Re[] and Im[]


As you know, Re[expr] and Im[expr] are left unevaluated when expr is
not numeric.  I had good luck in simple cases with the following
substitution trick:
  
        Real[c_]:=c/.I->0;     Imag[c_]:=(c-Real[c])/.I->1;

Do you see any problem with these definitions?


  • Prev by Date: Limit problem
  • Next by Date: Print with limited precision
  • Previous by thread: Re: Limit problem
  • Next by thread: Re: A way around the limitations of Re[] and Im[]