MathGroup Archive 2013

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

Search the Archive

Re: How to remove the "0." from "0. + 1.41774i"


On Thursday, June 20, 2013 4:01:33 AM UTC-4, Mike Bayville wrote:
> Can anyone suggest a built-in function for removing  the "0." from "0. + 1.41774i"?
> 
> 
> 
> Thanks!
> 
> 
> 
> Mike
> 
> 
> 
> INPUT
> 
> A={{-1.2, 1.5}, {-2.3, 1.2}};
> 
> Clear[eigenvalue];
> 
> {eigenvalue[1], eigenvalue[2]} = Chop[Eigenvalues[A]]
> 
> Chop[eigenvalue[1]]
> 
> Chop[eigenvalue[2]]
> 
> 
> 
> OUTPUT
> 
> {0. + 1.41774i, 0. - 1.41774i}
> 
> 0. + 1.41774i
> 
> 0. - 1.41774i

Try this

ToExpression[StringReplace[ToString[0. + 1.41774 i], "0." -> "" ]]

Effective but not elegant



  • Prev by Date: Re: NURBS Package Available
  • Next by Date: Duplex Printing from button inside DialogNotebook on Mac
  • Previous by thread: Re: How to remove the "0." from "0. + 1.41774i"
  • Next by thread: Re: How to remove the "0." from "0. + 1.41774i"