# HG changeset patch # User jwe # Date 1127424359 0 # Node ID ab7973a599cfac56718907910aeb756866457a80 # Parent 74804828df1a2013f88da7d528de166056e08f3e [project @ 2005-09-22 21:25:59 by jwe] diff -r 74804828df1a -r ab7973a599cf scripts/polynomial/residue.m --- a/scripts/polynomial/residue.m Thu Sep 22 18:36:23 2005 +0000 +++ b/scripts/polynomial/residue.m Thu Sep 22 21:25:59 2005 +0000 @@ -205,9 +205,16 @@ p = roots (a); lp = length (p); + + ## Determine if the poles are (effectively) zero. + index = find (abs (p) < toler); + if (length (index) != 0) + p (index) = 0; + endif + ## Determine if the poles are (effectively) real. - index = find (abs (imag (p) ./ real (p)) < toler); + index = find (abs(p)>=toler && ( abs(imag(p)) ./ abs(p) < toler )); if (length (index) != 0) p (index) = real (p (index)); endif