--- a/inst/symerr.m
+++ b/inst/symerr.m
@@ -50,11 +50,13 @@
   if (nargin < 2 || nargin > 4)
     print_usage ();
   endif
-  if (any (any (isinf (a))) || any (any (isnan (a))) || any (any (isinf (b))) || ...
-      any (any (isnan (b))) || !real (a) || !real (b) || ...
-      any (any (a != fix (a))) || any (any (b != fix (b))) || ...
-      any (any (a < 0)) || any (any (b < 0)))
-    error ("symerr: A and B must contain only positive integers");
+  if (! (!any (isinf (a(:))) && !any (isnan (a(:))) && all (isreal (a(:)))
+         && all (a(:) == fix (a(:))) && all (a(:) >= 0)))
+    error ("symerr: all elements of A must be non-negative integers");
+  endif
+  if (! (!any (isinf (b(:))) && !any (isnan (b(:))) && all (isreal (b(:)))
+         && all (b(:) == fix (b(:))) && all (b(:) >= 0)))
+    error ("symerr: all elements of B must be non-negative integers");
   endif
 
   [ar, ac] = size (a);