1

When I sum a complex number and its conjugate, that have been obtained when calculating the eigenvalues of a matrix, there is still an imaginary part that is equal to zero.

ev = {-0.8957457857324409` + 3.0607525560671736` I, 
      -0.8957457857324409` - 3.0607525560671736` I};

ev[[1]] + ev[[2]]

(* Out: -1.79149 + 0. I *)

How I eliminate the imaginary part if it is zero, to have a pure real number?

Using something like Re[-1.79149 + 0. I] is not sufficient as the summation of the eigenvalues that are calculated sometime have an imaginary part.

MarcoB
  • 67,153
  • 18
  • 91
  • 189
jarhead
  • 2,065
  • 12
  • 19

0 Answers0