comparison src/OPERATORS/op-fcs-fcs.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
comparison
equal deleted inserted replaced
9578:7dafdb8b062f 9579:42a18d5aff7f
92 gripe_divide_by_zero (); 92 gripe_divide_by_zero ();
93 93
94 return octave_value (v2.float_complex_value () / d); 94 return octave_value (v2.float_complex_value () / d);
95 } 95 }
96 96
97 DEFBINOP (lt, float_complex, float_complex) 97 DEFBINOP_OP (lt, float_complex, float_complex, <)
98 { 98 DEFBINOP_OP (le, float_complex, float_complex, <=)
99 CAST_BINOP_ARGS (const octave_float_complex&, const octave_float_complex&); 99 DEFBINOP_OP (eq, float_complex, float_complex, ==)
100 100 DEFBINOP_OP (ge, float_complex, float_complex, >=)
101 return real (v1.float_complex_value ()) < real (v2.float_complex_value ()); 101 DEFBINOP_OP (gt, float_complex, float_complex, >)
102 } 102 DEFBINOP_OP (ne, float_complex, float_complex, !=)
103
104 DEFBINOP (le, float_complex, float_complex)
105 {
106 CAST_BINOP_ARGS (const octave_float_complex&, const octave_float_complex&);
107
108 return real (v1.float_complex_value ()) <= real (v2.float_complex_value ());
109 }
110
111 DEFBINOP (eq, float_complex, float_complex)
112 {
113 CAST_BINOP_ARGS (const octave_float_complex&, const octave_float_complex&);
114
115 return v1.float_complex_value () == v2.float_complex_value ();
116 }
117
118 DEFBINOP (ge, float_complex, float_complex)
119 {
120 CAST_BINOP_ARGS (const octave_float_complex&, const octave_float_complex&);
121
122 return real (v1.float_complex_value ()) >= real (v2.float_complex_value ());
123 }
124
125 DEFBINOP (gt, float_complex, float_complex)
126 {
127 CAST_BINOP_ARGS (const octave_float_complex&, const octave_float_complex&);
128
129 return real (v1.float_complex_value ()) > real (v2.float_complex_value ());
130 }
131
132 DEFBINOP (ne, float_complex, float_complex)
133 {
134 CAST_BINOP_ARGS (const octave_float_complex&, const octave_float_complex&);
135
136 return v1.float_complex_value () != v2.float_complex_value ();
137 }
138 103
139 DEFBINOP_OP (el_mul, float_complex, float_complex, *) 104 DEFBINOP_OP (el_mul, float_complex, float_complex, *)
140 105
141 DEFBINOP (el_div, float_complex, float_complex) 106 DEFBINOP (el_div, float_complex, float_complex)
142 { 107 {