diff src/OPERATORS/op-fcs-fs.cc @ 9621:3ee9029931b3

fix scalar complex-real comparisons
author Jaroslav Hajek <highegg@gmail.com>
date Sun, 06 Sep 2009 07:41:34 +0200
parents eb63fbe60fab
children fb6b6fcafa62
line wrap: on
line diff
--- a/src/OPERATORS/op-fcs-fs.cc	Sat Sep 05 21:00:44 2009 -0400
+++ b/src/OPERATORS/op-fcs-fs.cc	Sun Sep 06 07:41:34 2009 +0200
@@ -71,47 +71,12 @@
   return octave_value (v2.float_value () / d);
 }
 
-DEFBINOP (lt, float_complex, float)
-{
-  CAST_BINOP_ARGS (const octave_float_complex&, const octave_float_scalar&);
-
-  return real (v1.float_complex_value ()) < v2.float_value ();
-}
-
-DEFBINOP (le, float_complex, float)
-{
-  CAST_BINOP_ARGS (const octave_float_complex&, const octave_float_scalar&);
-
-  return real (v1.float_complex_value ()) <= v2.float_value ();
-}
-
-DEFBINOP (eq, float_complex, float)
-{
-  CAST_BINOP_ARGS (const octave_float_complex&, const octave_float_scalar&);
-
-  return v1.float_complex_value () == v2.float_value ();
-}
-
-DEFBINOP (ge, float_complex, float)
-{
-  CAST_BINOP_ARGS (const octave_float_complex&, const octave_float_scalar&);
-
-  return real (v1.float_complex_value ()) >= v2.float_value ();
-}
-
-DEFBINOP (gt, float_complex, float)
-{
-  CAST_BINOP_ARGS (const octave_float_complex&, const octave_float_scalar&);
-
-  return real (v1.float_complex_value ()) > v2.float_value ();
-}
-
-DEFBINOP (ne, float_complex, float)
-{
-  CAST_BINOP_ARGS (const octave_float_complex&, const octave_float_scalar&);
-
-  return v1.float_complex_value () != v2.float_value ();
-}
+DEFCMPLXCMPOP_OP (lt, float_complex, float_scalar, <)
+DEFCMPLXCMPOP_OP (le, float_complex, float_scalar, <=)
+DEFCMPLXCMPOP_OP (eq, float_complex, float_scalar, ==)
+DEFCMPLXCMPOP_OP (ge, float_complex, float_scalar, >=)
+DEFCMPLXCMPOP_OP (gt, float_complex, float_scalar, >)
+DEFCMPLXCMPOP_OP (ne, float_complex, float_scalar, !=)
 
 DEFBINOP_OP (el_mul, float_complex, float_scalar, *)