Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2013

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

Search the Archive

How to remove the "0." from "0. + 1.41774i" [Revised]

  • To: mathgroup at smc.vnet.net
  • Subject: [mg131247] How to remove the "0." from "0. + 1.41774i" [Revised]
  • From: Mike Bayville <mike.bayville at gmail.com>
  • Date: Fri, 21 Jun 2013 05:58:50 -0400 (EDT)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com
  • Delivered-to: l-mathgroup@wolfram.com
  • Delivered-to: mathgroup-outx@smc.vnet.net
  • Delivered-to: mathgroup-newsendx@smc.vnet.net
  • References: <kpucst$9f7$1@smc.vnet.net>

I have some to realize that I failed to describe the context of my request.

I am hope to identify or create a function, e.g., mikechop[t_], such that the argument could be a real or complex number, and if it is a complex number such as:

0. + 1.41774i

or 

1.2313 x 10^(-16) + 1.41774i

the output will be:

1.41774i

otherwise it will be the real or complex number that was input.

This is for inclusion in code that I write.

Sorry for not properly describing the end use.

Humbly,

Mike





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



  • Prev by Date: Windows 8 Problem with Mathematica
  • Next by Date: Re: NURBS Package Available
  • Previous by thread: Re: Windows 8 Problem with Mathematica
  • Next by thread: Re: How to remove the "0." from "0. + 1.41774i" [Revised]