comparison 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
comparison
equal deleted inserted replaced
9620:b00af0da85dd 9621:3ee9029931b3
69 gripe_divide_by_zero (); 69 gripe_divide_by_zero ();
70 70
71 return octave_value (v2.float_value () / d); 71 return octave_value (v2.float_value () / d);
72 } 72 }
73 73
74 DEFBINOP (lt, float_complex, float) 74 DEFCMPLXCMPOP_OP (lt, float_complex, float_scalar, <)
75 { 75 DEFCMPLXCMPOP_OP (le, float_complex, float_scalar, <=)
76 CAST_BINOP_ARGS (const octave_float_complex&, const octave_float_scalar&); 76 DEFCMPLXCMPOP_OP (eq, float_complex, float_scalar, ==)
77 77 DEFCMPLXCMPOP_OP (ge, float_complex, float_scalar, >=)
78 return real (v1.float_complex_value ()) < v2.float_value (); 78 DEFCMPLXCMPOP_OP (gt, float_complex, float_scalar, >)
79 } 79 DEFCMPLXCMPOP_OP (ne, float_complex, float_scalar, !=)
80
81 DEFBINOP (le, float_complex, float)
82 {
83 CAST_BINOP_ARGS (const octave_float_complex&, const octave_float_scalar&);
84
85 return real (v1.float_complex_value ()) <= v2.float_value ();
86 }
87
88 DEFBINOP (eq, float_complex, float)
89 {
90 CAST_BINOP_ARGS (const octave_float_complex&, const octave_float_scalar&);
91
92 return v1.float_complex_value () == v2.float_value ();
93 }
94
95 DEFBINOP (ge, float_complex, float)
96 {
97 CAST_BINOP_ARGS (const octave_float_complex&, const octave_float_scalar&);
98
99 return real (v1.float_complex_value ()) >= v2.float_value ();
100 }
101
102 DEFBINOP (gt, float_complex, float)
103 {
104 CAST_BINOP_ARGS (const octave_float_complex&, const octave_float_scalar&);
105
106 return real (v1.float_complex_value ()) > v2.float_value ();
107 }
108
109 DEFBINOP (ne, float_complex, float)
110 {
111 CAST_BINOP_ARGS (const octave_float_complex&, const octave_float_scalar&);
112
113 return v1.float_complex_value () != v2.float_value ();
114 }
115 80
116 DEFBINOP_OP (el_mul, float_complex, float_scalar, *) 81 DEFBINOP_OP (el_mul, float_complex, float_scalar, *)
117 82
118 DEFBINOP (el_div, float_complex, float) 83 DEFBINOP (el_div, float_complex, float)
119 { 84 {