[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
minimum real number from a list of complex numbers
From: |
Robert Patterson |
Subject: |
minimum real number from a list of complex numbers |
Date: |
Fri, 29 Oct 2010 11:50:02 +0200 |
Hi,
I have a list of numbers (the roots of a list of quadratic equations)
that represent the times at which two particles collide. Some
collisions are impossible so that times have imaginary components. I
want to find the lowest purely real number from the list without writing
explicit loops.
For example from
v=[1, 2, 2+1i, 0 + 1i]
I want to find 1.
Does anyone have a good idea? I cannot see how to use isreal() for this
purpose.
Thanks
Robert
- minimum real number from a list of complex numbers,
Robert Patterson <=