Select list element around a value
HI
I would like to show all elements of allRootsAPow2 which are around 2 + 3*I this code below does not work ;-(
allRootsAPow2 =[2.00000000000000 + 3.00000000000000*I,
2.00000000000000 - 3.00000000000000*I,
-1.05087254532372e-32,
11.2111025509280 - 6.86482042695334e-16*I,
2.00000000000000 - 3.00000000000000*I,
2.00000000000000 + 3.00000000000000*I,
11.2111025509280 - 6.86482042695334e-16*I,
-1.05087254532372e-32,
2.00000000000000 + 3.00000000000000*I,
2.00000000000000 - 3.00000000000000*I,
-1.05087254532372e-32,
11.2111025509280 - 6.86482042695334e-16*I,
2.00000000000000 - 3.00000000000000*I,
2.00000000000000 + 3.00000000000000*I,
11.2111025509280 - 6.86482042695334e-16*I,
-1.05087254532372e-32,
-3.21110255092798 + 1.96623323036392e-16*I,
3.00992653992793e-33,
2.00000000000000 - 3.00000000000000*I,
2.00000000000000 + 3.00000000000000*I,
3.00992653992793e-33,
-3.21110255092798 + 1.96623323036392e-16*I,
2.00000000000000 + 3.00000000000000*I,
2.00000000000000 - 3.00000000000000*I,
-3.21110255092798 + 1.96623323036392e-16*I,
3.00992653992793e-33,
2.00000000000000 - 3.00000000000000*I,
2.00000000000000 + 3.00000000000000*I,
3.00992653992793e-33,
-3.21110255092798 + 1.96623323036392e-16*I,
2.00000000000000 + 3.00000000000000*I,
2.00000000000000 - 3.00000000000000*I]
for el in allRootsAPow2 :
if (math.ceil(el.real_part()*10)/10)== 2 and (math.ceil(el.imag_part()*10)/10)== 3 :
#if (math.ceil(el.real_part()*10)/10)== 2 :
#if (math.ceil(el.imag_part()*10)/10)== 3 :
show(el)
Sometimes it is better to show how the question arises, since a small change of the path to the problem is no longer showing the problem. Here explicitly: How (and why) do we compute the above redundant list
allRootsAPow2
?yes this code is just arranged to show the pb I get, but the title of my post is resuming what I would like ?