Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: How to remove the "0." from "0. + 1.41774i"
Replies: 8   Last Post: Jun 23, 2013 10:50 PM

 Messages: [ Previous | Next ]
 Nasser Abbasi Posts: 6,677 Registered: 2/7/05
Re: How to remove the "0." from "0. + 1.41774i"
Posted: Jun 21, 2013 5:42 AM

On 6/20/2013 3:01 AM, 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
>

Seems related to the thread "Multiplication by 0" 2 days ago?

I do not it is allowed to have a number with exact real part
and machine reals imaginary part. The complex system has to have
both parts either exact or both parts be machine reals. Can't mix
and match.

So you can't have

0 + 2. I

But you can have

0 + 2 I ===> which is 2I

and can have this

0. + 2. I

btw, I tested this on that other system, that starts its name
by "M" and ends with "E" and it behaves the same way:

-------------------------------
A:=Matrix([[-1.2, 1.5], [-2.3, 1.2]]):
a:=eig(A):
a[1];
-17
2.77555756156289 10 + 1.41774468787578 I

fnormal(%);
0. + 1.417744688 I
-----------------------------------

see:

In[33]:= 2 + 2. I
Out[33]= 2. + 2. I

Why is it important for you to remove the 0. from the display?
You can use Im and Re to obtain the real and imaginary parts of
complex number any time.

--Nasser

Date Subject Author
6/20/13 Mike Bayville
6/21/13 Nasser Abbasi
6/21/13 Mike Bayville
6/21/13 cj.girlie@gmail.com
6/21/13 Bill Rowe
6/22/13 Murray Eisenberg
6/23/13 Simons, F.H.