diff src/OPERATORS/op-cs-cs.cc @ 9579:42a18d5aff7f

make complex scalar cmp ops consistent
author Jaroslav Hajek <highegg@gmail.com>
date Thu, 27 Aug 2009 11:58:11 +0200
parents 19d298e6f7e5
children 319e2ab9b8ae
line wrap: on
line diff
--- a/src/OPERATORS/op-cs-cs.cc	Thu Aug 27 11:19:33 2009 +0200
+++ b/src/OPERATORS/op-cs-cs.cc	Thu Aug 27 11:58:11 2009 +0200
@@ -96,47 +96,12 @@
   return octave_value (v2.complex_value () / d);
 }
 
-DEFBINOP (lt, complex, complex)
-{
-  CAST_BINOP_ARGS (const octave_complex&, const octave_complex&);
-
-  return real (v1.complex_value ()) < real (v2.complex_value ());
-}
-
-DEFBINOP (le, complex, complex)
-{
-  CAST_BINOP_ARGS (const octave_complex&, const octave_complex&);
-
-  return real (v1.complex_value ()) <= real (v2.complex_value ());
-}
-
-DEFBINOP (eq, complex, complex)
-{
-  CAST_BINOP_ARGS (const octave_complex&, const octave_complex&);
-
-  return v1.complex_value () == v2.complex_value ();
-}
-
-DEFBINOP (ge, complex, complex)
-{
-  CAST_BINOP_ARGS (const octave_complex&, const octave_complex&);
-
-  return real (v1.complex_value ()) >= real (v2.complex_value ());
-}
-
-DEFBINOP (gt, complex, complex)
-{
-  CAST_BINOP_ARGS (const octave_complex&, const octave_complex&);
-
-  return real (v1.complex_value ()) > real (v2.complex_value ());
-}
-
-DEFBINOP (ne, complex, complex)
-{
-  CAST_BINOP_ARGS (const octave_complex&, const octave_complex&);
-
-  return v1.complex_value () != v2.complex_value ();
-}
+DEFBINOP_OP (lt, complex, complex, <)
+DEFBINOP_OP (le, complex, complex, <=)
+DEFBINOP_OP (eq, complex, complex, ==)
+DEFBINOP_OP (ge, complex, complex, >=)
+DEFBINOP_OP (gt, complex, complex, >)
+DEFBINOP_OP (ne, complex, complex, !=)
 
 DEFBINOP_OP (el_mul, complex, complex, *)