diff src/log.cc @ 718:e81d3a66725e

[project @ 1994-09-21 14:58:18 by jwe]
author jwe
date Wed, 21 Sep 1994 14:58:18 +0000
parents 36ba0576bd1b
children dfe01093f657
line wrap: on
line diff
--- a/src/log.cc	Wed Sep 21 14:53:22 1994 +0000
+++ b/src/log.cc	Wed Sep 21 14:58:18 1994 +0000
@@ -51,9 +51,13 @@
     }
 
   tree_constant arg = args(0);
-    
-  if (empty_arg ("logm", arg.rows (), arg.columns ()) < 0)
+
+  int arg_is_empty = empty_arg ("logm", arg.rows (), arg.columns ());
+
+  if (arg_is_empty < 0)
     return retval;
+  else if (arg_is_empty > 0)
+    return Matrix ();
 
   if (arg.is_real_scalar ())
     {
@@ -159,9 +163,13 @@
     }
 
   tree_constant arg = args(0);
-    
-  if (empty_arg ("sqrtm", arg.rows (), arg.columns ()))
+
+  int arg_is_empty = empty_arg ("sqrtm", arg.rows (), arg.columns ());
+
+  if (arg_is_empty < 0)
     return retval;
+  else if (arg_is_empty > 0)
+    return Matrix ();
 
   if (arg.is_real_scalar ())
     {