diff src/ov-complex.cc @ 2410:367485171742

[project @ 1996-10-15 16:50:27 by jwe]
author jwe
date Tue, 15 Oct 1996 16:50:28 +0000
parents 2142216bf85a
children de430cdd9234
line wrap: on
line diff
--- a/src/ov-complex.cc	Tue Oct 15 16:44:26 1996 +0000
+++ b/src/ov-complex.cc	Tue Oct 15 16:50:28 1996 +0000
@@ -31,7 +31,9 @@
 #include "lo-ieee.h"
 
 #include "oct-obj.h"
+#include "ops.h"
 #include "ov-complex.h"
+#include "ov-scalar.h"
 #include "gripes.h"
 #include "pr-output.h"
 
@@ -39,6 +41,17 @@
 
 const string octave_complex::t_name ("complex scalar");
 
+octave_value *
+octave_complex::try_narrowing_conversion (void)
+{
+  octave_value *retval = 0;
+
+  if (imag (scalar) == 0.0)
+    retval = new octave_scalar (::real (scalar));
+
+  return retval;
+}
+
 static inline bool
 valid_scalar_indices (const octave_value_list& args)
 {