changeset 5463:ab7973a599cf

[project @ 2005-09-22 21:25:59 by jwe]
author jwe
date Thu, 22 Sep 2005 21:25:59 +0000
parents 74804828df1a
children 9d0aab486882
files scripts/polynomial/residue.m
diffstat 1 files changed, 8 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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