Lines Matching refs:complex

2 //===--------------------------- complex ----------------------------------===//
14 complex synopsis
20 class complex
25 complex(const T& re = T(), const T& im = T()); // constexpr in C++14
26 complex(const complex&); // constexpr in C++14
27 template<class X> complex(const complex<X>&); // constexpr in C++14
35 complex<T>& operator= (const T&);
36 complex<T>& operator+=(const T&);
37 complex<T>& operator-=(const T&);
38 complex<T>& operator*=(const T&);
39 complex<T>& operator/=(const T&);
41 complex& operator=(const complex&);
42 template<class X> complex<T>& operator= (const complex<X>&);
43 template<class X> complex<T>& operator+=(const complex<X>&);
44 template<class X> complex<T>& operator-=(const complex<X>&);
45 template<class X> complex<T>& operator*=(const complex<X>&);
46 template<class X> complex<T>& operator/=(const complex<X>&);
50 class complex<float>
55 constexpr complex(float re = 0.0f, float im = 0.0f);
56 explicit constexpr complex(const complex<double>&);
57 explicit constexpr complex(const complex<long double>&);
64 complex<float>& operator= (float);
65 complex<float>& operator+=(float);
66 complex<float>& operator-=(float);
67 complex<float>& operator*=(float);
68 complex<float>& operator/=(float);
70 complex<float>& operator=(const complex<float>&);
71 template<class X> complex<float>& operator= (const complex<X>&);
72 template<class X> complex<float>& operator+=(const complex<X>&);
73 template<class X> complex<float>& operator-=(const complex<X>&);
74 template<class X> complex<float>& operator*=(const complex<X>&);
75 template<class X> complex<float>& operator/=(const complex<X>&);
79 class complex<double>
84 constexpr complex(double re = 0.0, double im = 0.0);
85 constexpr complex(const complex<float>&);
86 explicit constexpr complex(const complex<long double>&);
93 complex<double>& operator= (double);
94 complex<double>& operator+=(double);
95 complex<double>& operator-=(double);
96 complex<double>& operator*=(double);
97 complex<double>& operator/=(double);
98 complex<double>& operator=(const complex<double>&);
100 template<class X> complex<double>& operator= (const complex<X>&);
101 template<class X> complex<double>& operator+=(const complex<X>&);
102 template<class X> complex<double>& operator-=(const complex<X>&);
103 template<class X> complex<double>& operator*=(const complex<X>&);
104 template<class X> complex<double>& operator/=(const complex<X>&);
108 class complex<long double>
113 constexpr complex(long double re = 0.0L, long double im = 0.0L);
114 constexpr complex(const complex<float>&);
115 constexpr complex(const complex<double>&);
122 complex<long double>& operator=(const complex<long double>&);
123 complex<long double>& operator= (long double);
124 complex<long double>& operator+=(long double);
125 complex<long double>& operator-=(long double);
126 complex<long double>& operator*=(long double);
127 complex<long double>& operator/=(long double);
129 template<class X> complex<long double>& operator= (const complex<X>&);
130 template<class X> complex<long double>& operator+=(const complex<X>&);
131 template<class X> complex<long double>& operator-=(const complex<X>&);
132 template<class X> complex<long double>& operator*=(const complex<X>&);
133 template<class X> complex<long double>& operator/=(const complex<X>&);
137 template<class T> complex<T> operator+(const complex<T>&, const complex<T>&);
138 template<class T> complex<T> operator+(const complex<T>&, const T&);
139 template<class T> complex<T> operator+(const T&, const complex<T>&);
140 template<class T> complex<T> operator-(const complex<T>&, const complex<T>&);
141 template<class T> complex<T> operator-(const complex<T>&, const T&);
142 template<class T> complex<T> operator-(const T&, const complex<T>&);
143 template<class T> complex<T> operator*(const complex<T>&, const complex<T>&);
144 template<class T> complex<T> operator*(const complex<T>&, const T&);
145 template<class T> complex<T> operator*(const T&, const complex<T>&);
146 template<class T> complex<T> operator/(const complex<T>&, const complex<T>&);
147 template<class T> complex<T> operator/(const complex<T>&, const T&);
148 template<class T> complex<T> operator/(const T&, const complex<T>&);
149 template<class T> complex<T> operator+(const complex<T>&);
150 template<class T> complex<T> operator-(const complex<T>&);
151 template<class T> bool operator==(const complex<T>&, const complex<T>&); // constexpr in C++14
152 template<class T> bool operator==(const complex<T>&, const T&); // constexpr in C++14
153 template<class T> bool operator==(const T&, const complex<T>&); // constexpr in C++14
154 template<class T> bool operator!=(const complex<T>&, const complex<T>&); // constexpr in C++14
155 template<class T> bool operator!=(const complex<T>&, const T&); // constexpr in C++14
156 template<class T> bool operator!=(const T&, const complex<T>&); // constexpr in C++14
160 operator>>(basic_istream<charT, traits>&, complex<T>&);
163 operator<<(basic_ostream<charT, traits>&, const complex<T>&);
167 template<class T> T real(const complex<T>&); // constexpr in C++14
173 template<class T> T imag(const complex<T>&); // constexpr in C++14
179 template<class T> T abs(const complex<T>&);
181 template<class T> T arg(const complex<T>&);
187 template<class T> T norm(const complex<T>&);
193 template<class T> complex<T> conj(const complex<T>&);
194 complex<long double> conj(long double);
195 complex<double> conj(double);
196 template<Integral T> complex<double> conj(T);
197 complex<float> conj(float);
199 template<class T> complex<T> proj(const complex<T>&);
200 complex<long double> proj(long double);
201 complex<double> proj(double);
202 template<Integral T> complex<double> proj(T);
203 complex<float> proj(float);
205 template<class T> complex<T> polar(const T&, const T& = T());
208 template<class T> complex<T> acos(const complex<T>&);
209 template<class T> complex<T> asin(const complex<T>&);
210 template<class T> complex<T> atan(const complex<T>&);
211 template<class T> complex<T> acosh(const complex<T>&);
212 template<class T> complex<T> asinh(const complex<T>&);
213 template<class T> complex<T> atanh(const complex<T>&);
214 template<class T> complex<T> cos (const complex<T>&);
215 template<class T> complex<T> cosh (const complex<T>&);
216 template<class T> complex<T> exp (const complex<T>&);
217 template<class T> complex<T> log (const complex<T>&);
218 template<class T> complex<T> log10(const complex<T>&);
220 template<class T> complex<T> pow(const complex<T>&, const T&);
221 template<class T> complex<T> pow(const complex<T>&, const complex<T>&);
222 template<class T> complex<T> pow(const T&, const complex<T>&);
224 template<class T> complex<T> sin (const complex<T>&);
225 template<class T> complex<T> sinh (const complex<T>&);
226 template<class T> complex<T> sqrt (const complex<T>&);
227 template<class T> complex<T> tan (const complex<T>&);
228 template<class T> complex<T> tanh (const complex<T>&);
251 template<class _Tp> class _LIBCPP_TEMPLATE_VIS complex;
253 template<class _Tp> complex<_Tp> operator*(const complex<_Tp>& __z, const complex<_Tp>& __w);
254 template<class _Tp> complex<_Tp> operator/(const complex<_Tp>& __x, const complex<_Tp>& __y);
257 class _LIBCPP_TEMPLATE_VIS complex
266 complex(const value_type& __re = value_type(), const value_type& __im = value_type())
269 complex(const complex<_Xp>& __c)
278 _LIBCPP_INLINE_VISIBILITY complex& operator= (const value_type& __re)
280 …_LIBCPP_INLINE_VISIBILITY complex& operator+=(const value_type& __re) {__re_ += __re; return *this…
281 …_LIBCPP_INLINE_VISIBILITY complex& operator-=(const value_type& __re) {__re_ -= __re; return *this…
282 …_LIBCPP_INLINE_VISIBILITY complex& operator*=(const value_type& __re) {__re_ *= __re; __im_ *= __r…
283 …_LIBCPP_INLINE_VISIBILITY complex& operator/=(const value_type& __re) {__re_ /= __re; __im_ /= __r…
285 template<class _Xp> _LIBCPP_INLINE_VISIBILITY complex& operator= (const complex<_Xp>& __c)
291 template<class _Xp> _LIBCPP_INLINE_VISIBILITY complex& operator+=(const complex<_Xp>& __c)
297 template<class _Xp> _LIBCPP_INLINE_VISIBILITY complex& operator-=(const complex<_Xp>& __c)
303 template<class _Xp> _LIBCPP_INLINE_VISIBILITY complex& operator*=(const complex<_Xp>& __c)
305 *this = *this * complex(__c.real(), __c.imag());
308 template<class _Xp> _LIBCPP_INLINE_VISIBILITY complex& operator/=(const complex<_Xp>& __c)
310 *this = *this / complex(__c.real(), __c.imag());
315 template<> class _LIBCPP_TEMPLATE_VIS complex<double>;
316 template<> class _LIBCPP_TEMPLATE_VIS complex<long double>;
319 class _LIBCPP_TEMPLATE_VIS complex<float>
326 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR complex(float __re = 0.0f, float __im = 0.0f)
329 explicit _LIBCPP_CONSTEXPR complex(const complex<double>& __c);
331 explicit _LIBCPP_CONSTEXPR complex(const complex<long double>& __c);
339 _LIBCPP_INLINE_VISIBILITY complex& operator= (float __re)
341 _LIBCPP_INLINE_VISIBILITY complex& operator+=(float __re) {__re_ += __re; return *this;}
342 _LIBCPP_INLINE_VISIBILITY complex& operator-=(float __re) {__re_ -= __re; return *this;}
343 …_LIBCPP_INLINE_VISIBILITY complex& operator*=(float __re) {__re_ *= __re; __im_ *= __re; return *t…
344 …_LIBCPP_INLINE_VISIBILITY complex& operator/=(float __re) {__re_ /= __re; __im_ /= __re; return *t…
346 template<class _Xp> _LIBCPP_INLINE_VISIBILITY complex& operator= (const complex<_Xp>& __c)
352 template<class _Xp> _LIBCPP_INLINE_VISIBILITY complex& operator+=(const complex<_Xp>& __c)
358 template<class _Xp> _LIBCPP_INLINE_VISIBILITY complex& operator-=(const complex<_Xp>& __c)
364 template<class _Xp> _LIBCPP_INLINE_VISIBILITY complex& operator*=(const complex<_Xp>& __c)
366 *this = *this * complex(__c.real(), __c.imag());
369 template<class _Xp> _LIBCPP_INLINE_VISIBILITY complex& operator/=(const complex<_Xp>& __c)
371 *this = *this / complex(__c.real(), __c.imag());
377 class _LIBCPP_TEMPLATE_VIS complex<double>
384 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR complex(double __re = 0.0, double __im = 0.0)
387 _LIBCPP_CONSTEXPR complex(const complex<float>& __c);
389 explicit _LIBCPP_CONSTEXPR complex(const complex<long double>& __c);
397 _LIBCPP_INLINE_VISIBILITY complex& operator= (double __re)
399 _LIBCPP_INLINE_VISIBILITY complex& operator+=(double __re) {__re_ += __re; return *this;}
400 _LIBCPP_INLINE_VISIBILITY complex& operator-=(double __re) {__re_ -= __re; return *this;}
401 …_LIBCPP_INLINE_VISIBILITY complex& operator*=(double __re) {__re_ *= __re; __im_ *= __re; return *…
402 …_LIBCPP_INLINE_VISIBILITY complex& operator/=(double __re) {__re_ /= __re; __im_ /= __re; return *…
404 template<class _Xp> _LIBCPP_INLINE_VISIBILITY complex& operator= (const complex<_Xp>& __c)
410 template<class _Xp> _LIBCPP_INLINE_VISIBILITY complex& operator+=(const complex<_Xp>& __c)
416 template<class _Xp> _LIBCPP_INLINE_VISIBILITY complex& operator-=(const complex<_Xp>& __c)
422 template<class _Xp> _LIBCPP_INLINE_VISIBILITY complex& operator*=(const complex<_Xp>& __c)
424 *this = *this * complex(__c.real(), __c.imag());
427 template<class _Xp> _LIBCPP_INLINE_VISIBILITY complex& operator/=(const complex<_Xp>& __c)
429 *this = *this / complex(__c.real(), __c.imag());
435 class _LIBCPP_TEMPLATE_VIS complex<long double>
442 …_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR complex(long double __re = 0.0L, long double __im = 0.…
445 _LIBCPP_CONSTEXPR complex(const complex<float>& __c);
447 _LIBCPP_CONSTEXPR complex(const complex<double>& __c);
455 _LIBCPP_INLINE_VISIBILITY complex& operator= (long double __re)
457 _LIBCPP_INLINE_VISIBILITY complex& operator+=(long double __re) {__re_ += __re; return *this;}
458 _LIBCPP_INLINE_VISIBILITY complex& operator-=(long double __re) {__re_ -= __re; return *this;}
459 …_LIBCPP_INLINE_VISIBILITY complex& operator*=(long double __re) {__re_ *= __re; __im_ *= __re; ret…
460 …_LIBCPP_INLINE_VISIBILITY complex& operator/=(long double __re) {__re_ /= __re; __im_ /= __re; ret…
462 template<class _Xp> _LIBCPP_INLINE_VISIBILITY complex& operator= (const complex<_Xp>& __c)
468 template<class _Xp> _LIBCPP_INLINE_VISIBILITY complex& operator+=(const complex<_Xp>& __c)
474 template<class _Xp> _LIBCPP_INLINE_VISIBILITY complex& operator-=(const complex<_Xp>& __c)
480 template<class _Xp> _LIBCPP_INLINE_VISIBILITY complex& operator*=(const complex<_Xp>& __c)
482 *this = *this * complex(__c.real(), __c.imag());
485 template<class _Xp> _LIBCPP_INLINE_VISIBILITY complex& operator/=(const complex<_Xp>& __c)
487 *this = *this / complex(__c.real(), __c.imag());
494 complex<float>::complex(const complex<double>& __c)
499 complex<float>::complex(const complex<long double>& __c)
504 complex<double>::complex(const complex<float>& __c)
509 complex<double>::complex(const complex<long double>& __c)
514 complex<long double>::complex(const complex<float>& __c)
519 complex<long double>::complex(const complex<double>& __c)
526 complex<_Tp>
527 operator+(const complex<_Tp>& __x, const complex<_Tp>& __y)
529 complex<_Tp> __t(__x);
536 complex<_Tp>
537 operator+(const complex<_Tp>& __x, const _Tp& __y)
539 complex<_Tp> __t(__x);
546 complex<_Tp>
547 operator+(const _Tp& __x, const complex<_Tp>& __y)
549 complex<_Tp> __t(__y);
556 complex<_Tp>
557 operator-(const complex<_Tp>& __x, const complex<_Tp>& __y)
559 complex<_Tp> __t(__x);
566 complex<_Tp>
567 operator-(const complex<_Tp>& __x, const _Tp& __y)
569 complex<_Tp> __t(__x);
576 complex<_Tp>
577 operator-(const _Tp& __x, const complex<_Tp>& __y)
579 complex<_Tp> __t(-__y);
585 complex<_Tp>
586 operator*(const complex<_Tp>& __z, const complex<_Tp>& __w)
640 return complex<_Tp>(__x, __y);
645 complex<_Tp>
646 operator*(const complex<_Tp>& __x, const _Tp& __y)
648 complex<_Tp> __t(__x);
655 complex<_Tp>
656 operator*(const _Tp& __x, const complex<_Tp>& __y)
658 complex<_Tp> __t(__y);
664 complex<_Tp>
665 operator/(const complex<_Tp>& __z, const complex<_Tp>& __w)
704 return complex<_Tp>(__x, __y);
709 complex<_Tp>
710 operator/(const complex<_Tp>& __x, const _Tp& __y)
712 return complex<_Tp>(__x.real() / __y, __x.imag() / __y);
717 complex<_Tp>
718 operator/(const _Tp& __x, const complex<_Tp>& __y)
720 complex<_Tp> __t(__x);
727 complex<_Tp>
728 operator+(const complex<_Tp>& __x)
735 complex<_Tp>
736 operator-(const complex<_Tp>& __x)
738 return complex<_Tp>(-__x.real(), -__x.imag());
744 operator==(const complex<_Tp>& __x, const complex<_Tp>& __y)
752 operator==(const complex<_Tp>& __x, const _Tp& __y)
760 operator==(const _Tp& __x, const complex<_Tp>& __y)
768 operator!=(const complex<_Tp>& __x, const complex<_Tp>& __y)
776 operator!=(const complex<_Tp>& __x, const _Tp& __y)
784 operator!=(const _Tp& __x, const complex<_Tp>& __y)
801 typedef complex<double> _ComplexType;
809 typedef complex<_Tp> _ComplexType;
817 real(const complex<_Tp>& __c)
835 imag(const complex<_Tp>& __c)
853 abs(const complex<_Tp>& __c)
863 arg(const complex<_Tp>& __c)
907 norm(const complex<_Tp>& __c)
929 complex<_Tp>
930 conj(const complex<_Tp>& __c)
932 return complex<_Tp>(__c.real(), -__c.imag());
950 complex<_Tp>
951 proj(const complex<_Tp>& __c)
953 complex<_Tp> __r = __c;
955 __r = complex<_Tp>(INFINITY, copysign(_Tp(0), __c.imag()));
970 return complex<_Tp>(__re);
989 complex<_Tp>
993 return complex<_Tp>(_Tp(NAN), _Tp(NAN));
997 return complex<_Tp>(__rho, __theta);
998 return complex<_Tp>(__theta, __theta);
1003 return complex<_Tp>(__rho, _Tp(NAN));
1004 return complex<_Tp>(_Tp(NAN), _Tp(NAN));
1012 return complex<_Tp>(__x, __y);
1019 complex<_Tp>
1020 log(const complex<_Tp>& __x)
1022 return complex<_Tp>(log(abs(__x)), arg(__x));
1029 complex<_Tp>
1030 log10(const complex<_Tp>& __x)
1038 complex<_Tp>
1039 sqrt(const complex<_Tp>& __x)
1042 return complex<_Tp>(_Tp(INFINITY), __x.imag());
1046 …return complex<_Tp>(__x.real(), __libcpp_isnan_or_builtin(__x.imag()) ? __x.imag() : copysign(_Tp(…
1047 …return complex<_Tp>(__libcpp_isnan_or_builtin(__x.imag()) ? __x.imag() : _Tp(0), copysign(__x.real…
1055 complex<_Tp>
1056 exp(const complex<_Tp>& __x)
1070 return complex<_Tp>(__x.real(), __i);
1076 return complex<_Tp>(__e * cos(__i), __e * sin(__i));
1083 complex<_Tp>
1084 pow(const complex<_Tp>& __x, const complex<_Tp>& __y)
1091 complex<typename __promote<_Tp, _Up>::type>
1092 pow(const complex<_Tp>& __x, const complex<_Up>& __y)
1094 typedef complex<typename __promote<_Tp, _Up>::type> result_type;
1103 complex<typename __promote<_Tp, _Up>::type>
1105 pow(const complex<_Tp>& __x, const _Up& __y)
1107 typedef complex<typename __promote<_Tp, _Up>::type> result_type;
1116 complex<typename __promote<_Tp, _Up>::type>
1118 pow(const _Tp& __x, const complex<_Up>& __y)
1120 typedef complex<typename __promote<_Tp, _Up>::type> result_type;
1128 complex<_Tp>
1129 __sqr(const complex<_Tp>& __x)
1131 return complex<_Tp>((__x.real() - __x.imag()) * (__x.real() + __x.imag()),
1138 complex<_Tp>
1139 asinh(const complex<_Tp>& __x)
1147 return complex<_Tp>(__x.real(), copysign(__pi * _Tp(0.25), __x.imag()));
1148 return complex<_Tp>(__x.real(), copysign(_Tp(0), __x.imag()));
1153 return complex<_Tp>(__x.imag(), __x.real());
1156 return complex<_Tp>(__x.real(), __x.real());
1159 return complex<_Tp>(copysign(__x.imag(), __x.real()), copysign(__pi/_Tp(2), __x.imag()));
1160 complex<_Tp> __z = log(__x + sqrt(__sqr(__x) + _Tp(1)));
1161 return complex<_Tp>(copysign(__z.real(), __x.real()), copysign(__z.imag(), __x.imag()));
1167 complex<_Tp>
1168 acosh(const complex<_Tp>& __x)
1174 return complex<_Tp>(abs(__x.real()), __x.imag());
1178 return complex<_Tp>(__x.real(), copysign(__pi * _Tp(0.25), __x.imag()));
1180 return complex<_Tp>(-__x.real(), copysign(__pi * _Tp(0.75), __x.imag()));
1183 return complex<_Tp>(-__x.real(), copysign(__pi, __x.imag()));
1184 return complex<_Tp>(__x.real(), copysign(_Tp(0), __x.imag()));
1189 return complex<_Tp>(abs(__x.imag()), __x.real());
1190 return complex<_Tp>(__x.real(), __x.real());
1193 return complex<_Tp>(abs(__x.imag()), copysign(__pi/_Tp(2), __x.imag()));
1194 complex<_Tp> __z = log(__x + sqrt(__sqr(__x) - _Tp(1)));
1195 return complex<_Tp>(copysign(__z.real(), _Tp(0)), copysign(__z.imag(), __x.imag()));
1201 complex<_Tp>
1202 atanh(const complex<_Tp>& __x)
1207 return complex<_Tp>(copysign(_Tp(0), __x.real()), copysign(__pi/_Tp(2), __x.imag()));
1212 return complex<_Tp>(copysign(_Tp(0), __x.real()), __x.imag());
1213 return complex<_Tp>(__x.imag(), __x.imag());
1217 return complex<_Tp>(__x.real(), __x.real());
1221 return complex<_Tp>(copysign(_Tp(0), __x.real()), copysign(__pi/_Tp(2), __x.imag()));
1225 return complex<_Tp>(copysign(_Tp(INFINITY), __x.real()), copysign(_Tp(0), __x.imag()));
1227 complex<_Tp> __z = log((_Tp(1) + __x) / (_Tp(1) - __x)) / _Tp(2);
1228 return complex<_Tp>(copysign(__z.real(), __x.real()), copysign(__z.imag(), __x.imag()));
1234 complex<_Tp>
1235 sinh(const complex<_Tp>& __x)
1238 return complex<_Tp>(__x.real(), _Tp(NAN));
1240 return complex<_Tp>(__x.real(), _Tp(NAN));
1243 return complex<_Tp>(sinh(__x.real()) * cos(__x.imag()), cosh(__x.real()) * sin(__x.imag()));
1249 complex<_Tp>
1250 cosh(const complex<_Tp>& __x)
1253 return complex<_Tp>(abs(__x.real()), _Tp(NAN));
1255 return complex<_Tp>(_Tp(NAN), __x.real());
1257 return complex<_Tp>(_Tp(1), __x.imag());
1259 return complex<_Tp>(abs(__x.real()), __x.imag());
1260 return complex<_Tp>(cosh(__x.real()) * cos(__x.imag()), sinh(__x.real()) * sin(__x.imag()));
1266 complex<_Tp>
1267 tanh(const complex<_Tp>& __x)
1272 return complex<_Tp>(_Tp(1), _Tp(0));
1273 return complex<_Tp>(_Tp(1), copysign(_Tp(0), sin(_Tp(2) * __x.imag())));
1282 return complex<_Tp>(__2rsh > _Tp(0) ? _Tp(1) : _Tp(-1),
1284 return complex<_Tp>(__2rsh/__d, sin(__2i)/__d);
1290 complex<_Tp>
1291 asin(const complex<_Tp>& __x)
1293 complex<_Tp> __z = asinh(complex<_Tp>(-__x.imag(), __x.real()));
1294 return complex<_Tp>(__z.imag(), -__z.real());
1300 complex<_Tp>
1301 acos(const complex<_Tp>& __x)
1307 return complex<_Tp>(__x.imag(), __x.real());
1311 return complex<_Tp>(_Tp(0.75) * __pi, -__x.imag());
1312 return complex<_Tp>(_Tp(0.25) * __pi, -__x.imag());
1315 return complex<_Tp>(__pi, signbit(__x.imag()) ? -__x.real() : __x.real());
1316 return complex<_Tp>(_Tp(0), signbit(__x.imag()) ? __x.real() : -__x.real());
1321 return complex<_Tp>(__x.real(), -__x.imag());
1322 return complex<_Tp>(__x.real(), __x.real());
1325 return complex<_Tp>(__pi/_Tp(2), -__x.imag());
1327 return complex<_Tp>(__pi/_Tp(2), -__x.imag());
1328 complex<_Tp> __z = log(__x + sqrt(__sqr(__x) - _Tp(1)));
1330 return complex<_Tp>(abs(__z.imag()), abs(__z.real()));
1331 return complex<_Tp>(abs(__z.imag()), -abs(__z.real()));
1337 complex<_Tp>
1338 atan(const complex<_Tp>& __x)
1340 complex<_Tp> __z = atanh(complex<_Tp>(-__x.imag(), __x.real()));
1341 return complex<_Tp>(__z.imag(), -__z.real());
1347 complex<_Tp>
1348 sin(const complex<_Tp>& __x)
1350 complex<_Tp> __z = sinh(complex<_Tp>(-__x.imag(), __x.real()));
1351 return complex<_Tp>(__z.imag(), -__z.real());
1358 complex<_Tp>
1359 cos(const complex<_Tp>& __x)
1361 return cosh(complex<_Tp>(-__x.imag(), __x.real()));
1367 complex<_Tp>
1368 tan(const complex<_Tp>& __x)
1370 complex<_Tp> __z = tanh(complex<_Tp>(-__x.imag(), __x.real()));
1371 return complex<_Tp>(__z.imag(), -__z.real());
1376 operator>>(basic_istream<_CharT, _Traits>& __is, complex<_Tp>& __x)
1402 __x = complex<_Tp>(__r, __i);
1413 __x = complex<_Tp>(__r, _Tp(0));
1426 __x = complex<_Tp>(__r, _Tp(0));
1439 operator<<(basic_ostream<_CharT, _Traits>& __os, const complex<_Tp>& __x)
1451 // Literal suffix for complex number literals [complex.literals]
1456 constexpr complex<long double> operator""il(long double __im)
1461 constexpr complex<long double> operator""il(unsigned long long __im)
1467 constexpr complex<double> operator""i(long double __im)
1472 constexpr complex<double> operator""i(unsigned long long __im)
1478 constexpr complex<float> operator""if(long double __im)
1483 constexpr complex<float> operator""if(unsigned long long __im)