Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #14954

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

From cj.girlie@gmail.com
Newsgroups comp.soft-sys.math.mathematica
Subject Re: How to remove the "0." from "0. + 1.41774i"
Date 2013-06-21 09:43 +0000
Message-ID <kq178p$gnq$1@smc.vnet.net> (permalink)
References <kpucst$9f7$1@smc.vnet.net>
Organization Time-Warner Telecom

Show all headers | View raw


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

Back to comp.soft-sys.math.mathematica | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

How to remove the "0." from "0. + 1.41774i" Mike Bayville <mike.bayville@gmail.com> - 2013-06-20 08:01 +0000
  Re: How to remove the "0." from "0. + 1.41774i" cj.girlie@gmail.com - 2013-06-21 09:43 +0000
  Re: How to remove the "0." from "0. + 1.41774i" "Nasser M. Abbasi" <nma@12000.org> - 2013-06-21 09:42 +0000
  How to remove the "0." from "0. + 1.41774i"  [Revised] Mike Bayville <mike.bayville@gmail.com> - 2013-06-21 09:43 +0000
  Re: How to remove the "0." from "0. + 1.41774i"  [Revised] Murray Eisenberg <murray@math.umass.edu> - 2013-06-22 07:27 +0000
  Re: How to remove the "0." from "0. + 1.41774i"  [Revised] Fred Simons <f.h.simons@tue.nl> - 2013-06-24 02:50 +0000

csiph-web