26 #if defined (HAVE_CONFIG_H)
45 #define DEF_COMPLEXR_COMP(OP, OPS) \
46 template <typename T> \
47 bool operator OP (const std::complex<T>& a, const std::complex<T>& b) \
49 OCTAVE_FLOAT_TRUNCATE const T ax = std::abs (a); \
50 OCTAVE_FLOAT_TRUNCATE const T bx = std::abs (b); \
53 OCTAVE_FLOAT_TRUNCATE const T ay = std::arg (a); \
54 OCTAVE_FLOAT_TRUNCATE const T by = std::arg (b); \
55 if (ay == static_cast<T> (-M_PI)) \
57 if (by != static_cast<T> (-M_PI)) \
58 return static_cast<T> (M_PI) OP by; \
60 else if (by == static_cast<T> (-M_PI)) \
62 return ay OP static_cast<T> (M_PI); \
69 template <typename T> \
70 bool operator OP (const std::complex<T>& a, T b) \
72 OCTAVE_FLOAT_TRUNCATE const T ax = std::abs (a); \
73 OCTAVE_FLOAT_TRUNCATE const T bx = std::abs (b); \
76 OCTAVE_FLOAT_TRUNCATE const T ay = std::arg (a); \
77 if (ay == static_cast<T> (-M_PI)) \
78 return static_cast<T> (M_PI) OP 0; \
84 template <typename T> \
85 bool operator OP (T a, const std::complex<T>& b) \
87 OCTAVE_FLOAT_TRUNCATE const T ax = std::abs (a); \
88 OCTAVE_FLOAT_TRUNCATE const T bx = std::abs (b); \
91 OCTAVE_FLOAT_TRUNCATE const T by = std::arg (b); \
92 if (by == static_cast<T> (-M_PI)) \
93 return 0 OP static_cast<T> (M_PI); \
100 #if defined (__APPLE__)
112 # define A_PI 3.1415925025939941f
114 # define INST_SPECIAL_COMPLEXR_COMP(OP, OPS) \
115 template <> OCTAVE_API \
116 bool operator OP<float> (const std::complex<float>& a, \
117 const std::complex<float>& b) \
119 OCTAVE_FLOAT_TRUNCATE const float ax = std::abs (a); \
120 OCTAVE_FLOAT_TRUNCATE const float bx = std::abs (b); \
123 OCTAVE_FLOAT_TRUNCATE const float ay = std::arg (a); \
124 OCTAVE_FLOAT_TRUNCATE const float by = std::arg (b); \
128 return static_cast<float> (M_PI) OP by; \
130 else if (by == -A_PI) \
132 return ay OP static_cast<float> (M_PI); \
139 template <> OCTAVE_API \
140 bool operator OP<float> (const std::complex<float>& a, float b) \
142 OCTAVE_FLOAT_TRUNCATE const float ax = std::abs (a); \
143 OCTAVE_FLOAT_TRUNCATE const float bx = std::abs (b); \
146 OCTAVE_FLOAT_TRUNCATE const float ay = std::arg (a); \
148 return static_cast<float> (M_PI) OP 0; \
154 template <> OCTAVE_API \
155 bool operator OP<float> (float a, const std::complex<float>& b) \
157 OCTAVE_FLOAT_TRUNCATE const float ax = std::abs (a); \
158 OCTAVE_FLOAT_TRUNCATE const float bx = std::abs (b); \
161 OCTAVE_FLOAT_TRUNCATE const float by = std::arg (b); \
163 return 0 OP static_cast<float> (M_PI); \
180 # define INST_COMPLEXR_COMP(OP, T) \
181 template OCTAVE_API bool operator OP (const std::complex<T>& a, \
182 const std::complex<T>& b); \
183 template OCTAVE_API bool operator OP (const std::complex<T>& a, T b); \
184 template OCTAVE_API bool operator OP (T a, const std::complex<T>& b);
191 #if defined (__APPLE__)
192 INST_SPECIAL_COMPLEXR_COMP (>, >)
193 INST_SPECIAL_COMPLEXR_COMP (<, <)
194 INST_SPECIAL_COMPLEXR_COMP (>=, >)
195 INST_SPECIAL_COMPLEXR_COMP (<=, <)
#define DEF_COMPLEXR_COMP(OP, OPS)
#define INST_COMPLEXR_COMP(OP, T)