diff src/OPERATORS/op-fs-fcs.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-fs-fcs.cc	Sat Sep 05 21:00:44 2009 -0400
+++ b/src/OPERATORS/op-fs-fcs.cc	Sun Sep 06 07:41:34 2009 +0200
@@ -71,47 +71,12 @@
   return octave_value (v2.float_complex_value () / d);
 }
 
-DEFBINOP (lt, float_scalar, float_complex)
-{
-  CAST_BINOP_ARGS (const octave_float_scalar&, const octave_float_complex&);
-
-  return v1.float_value () < real (v2.float_complex_value ());
-}
-
-DEFBINOP (le, float_scalar, float_complex)
-{
-  CAST_BINOP_ARGS (const octave_float_scalar&, const octave_float_complex&);
-
-  return v1.float_value () <= real (v2.float_complex_value ());
-}
-
-DEFBINOP (eq, float_scalar, float_complex)
-{
-  CAST_BINOP_ARGS (const octave_float_scalar&, const octave_float_complex&);
-
-  return v1.float_value () == v2.float_complex_value ();
-}
-
-DEFBINOP (ge, float_scalar, float_complex)
-{
-  CAST_BINOP_ARGS (const octave_float_scalar&, const octave_float_complex&);
-
-  return v1.float_value () >= real (v2.float_complex_value ());
-}
-
-DEFBINOP (gt, float_scalar, float_complex)
-{
-  CAST_BINOP_ARGS (const octave_float_scalar&, const octave_float_complex&);
-
-  return v1.float_value () > real (v2.float_complex_value ());
-}
-
-DEFBINOP (ne, float_scalar, float_complex)
-{
-  CAST_BINOP_ARGS (const octave_float_scalar&, const octave_float_complex&);
-
-  return v1.float_value () != v2.float_complex_value ();
-}
+DEFCMPLXCMPOP_OP (lt, float_scalar, float_complex, <)
+DEFCMPLXCMPOP_OP (le, float_scalar, float_complex, <=)
+DEFCMPLXCMPOP_OP (eq, float_scalar, float_complex, ==)
+DEFCMPLXCMPOP_OP (ge, float_scalar, float_complex, >=)
+DEFCMPLXCMPOP_OP (gt, float_scalar, float_complex, >)
+DEFCMPLXCMPOP_OP (ne, float_scalar, float_complex, !=)
 
 DEFBINOP_OP (el_mul, float_scalar, float_complex, *)