Skip to content

Commit 712f78a

Browse files
committed
isclose instead of subtract
1 parent d26d639 commit 712f78a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

control/xferfcn.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -874,8 +874,10 @@ def _common_den(self, imag_tol=None):
874874
currentpoles = poleset[i][j][1]
875875
nothave = ones(currentpoles.shape, dtype=bool)
876876
for ip, p in enumerate(poles[j]):
877-
collect = ((abs(currentpoles.real - p.real) < real_tol) &
878-
(abs(currentpoles.imag - p.imag) < imag_tol) &
877+
collect = (np.isclose(currentpoles.real, p.real,
878+
atol=real_tol) &
879+
np.isclose(currentpoles.imag, p.imag,
880+
atol=imag_tol) &
879881
nothave)
880882
if np.any(collect):
881883
# mark first found pole as already collected

0 commit comments

Comments
 (0)