Approximated complex numbers. How I put them to zero?

  • #1
Dear all,
I'm fighting against complicated expressions which contain complex numbers that, after some calculations and simplifications, appear in a form like: 1. + 0.I. I think that this weighs down the next calculations.
The question is: how can I put zero the imaginary part? or, in general, how can I set a threshold for a number under which it must be considered as zero?
Thank you very much!

Teo
 

Answers and Replies

  • #2
CompuChip
Science Advisor
Homework Helper
4,302
47
Looking at your notation, I suspect you are talking about Mathematica?
In that case, you could try
Code:
Chop[x]
You can also set your own threshold, with Chop[expr, delta].
 
  • #3
Ok...thank you very much!
I was absolutely convinced to have put the Mathematica reference...I've learned: never to be convinced!
Thanks again...I will try!
 

Related Threads on Approximated complex numbers. How I put them to zero?

Replies
4
Views
2K
  • Last Post
Replies
7
Views
2K
  • Last Post
Replies
10
Views
3K
  • Last Post
Replies
3
Views
2K
  • Last Post
Replies
1
Views
2K
  • Last Post
Replies
3
Views
2K
  • Last Post
Replies
1
Views
2K
  • Last Post
Replies
5
Views
4K
Top