diff src/pt-const.cc @ 206:1761d7a3770c

[project @ 1993-11-10 21:00:31 by jwe]
author jwe
date Wed, 10 Nov 1993 21:00:31 +0000
parents b6b4d8c513fe
children 1468a5e6a466
line wrap: on
line diff
--- a/src/pt-const.cc
+++ b/src/pt-const.cc
@@ -1543,8 +1543,11 @@
 {
   switch (type_tag)
     {
+    case scalar_constant:
+      return Matrix (scalar);
     case matrix_constant:
       return *matrix;
+    case complex_scalar_constant:
     case complex_matrix_constant:
       {
 	int flag = user_pref.ok_to_lose_imaginary_part;
@@ -1552,7 +1555,14 @@
 	  warning ("implicit conversion of complex matrix to real matrix"); 
 
 	if (flag != 0)
-	  return real (*complex_matrix);
+	  {
+	    if (type_tag == complex_scalar_constant)
+	      return Matrix (real (*complex_scalar));
+	    else if (type_tag == complex_matrix_constant)
+	      return real (*complex_matrix);
+	    else
+	      panic_impossible ();
+	  }
 	else
 	  error ("implicit conversion of complex matrix to real matrix not allowed");
 	jump_to_top_level ();