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


Groups > comp.soft-sys.math.mathematica > #14956 > unrolled thread

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

Started byMike Bayville <mike.bayville@gmail.com>
First post2013-06-21 09:44 +0000
Last post2013-06-21 09:44 +0000
Articles 1 — 1 participant

Back to article view | Back to comp.soft-sys.math.mathematica

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: How to remove the "0." from "0. + 1.41774i" Mike Bayville <mike.bayville@gmail.com> - 2013-06-21 09:44 +0000

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

FromMike Bayville <mike.bayville@gmail.com>
Date2013-06-21 09:44 +0000
SubjectRe: How to remove the "0." from "0. + 1.41774i"
Message-ID<kq17am$go2$1@smc.vnet.net>
Thanks, but Rationalize works in the manner you executed it; however, it
does not work like this...

In[216]:= nuChop[t_] = Rationalize[t];
              A = {{-1.2, 1.5}, {-2.3, 1.2}};
              eigval1 = Eigenvalues[A][[1]]
              nuChop[eigval1]

Out[218]= 2.7755576*10^-17 + 1.4177447 I

Out[219]= 2.7755576*10^-17 + 1.4177447 I


On Thu, Jun 20, 2013 at 7:54 AM, Sseziwa Mukasa <mukasa@gmail.com> wrote:

> (Debug) In[3]:= Rationalize[0. + 1.41774 I]
> (Debug) Out[3]= (70887 I)/50000
>
> That has it's own problems with respect to large values in the numerator
> or denominator.
>
> On Jun 20, 2013, at 4:44 AM, Mike Bayville <mike.bayville@gmail.com>
> 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
> >
>
>

[toc] | [standalone]


Back to top | Article view | comp.soft-sys.math.mathematica


csiph-web