Lines Matching refs:real
30 T real() const; // constexpr in C++14
33 void real(T);
60 constexpr float real() const;
61 void real(float);
89 constexpr double real() const;
90 void real(double);
118 constexpr long double real() const;
119 void real(long double);
168 template<class T> T real(const complex<T>&); // constexpr in C++14
169 long double real(long double); // constexpr in C++14
170 double real(double); // constexpr in C++14
171 template<Integral T> double real(T); // constexpr in C++14
172 float real(float); // constexpr in C++14
277 : __re_(__c.real()), __im_(__c.imag()) {}
279 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 value_type real() const {return __re_;}
282 _LIBCPP_INLINE_VISIBILITY void real(value_type __re) {__re_ = __re;}
294 __re_ = __c.real();
300 __re_ += __c.real();
306 __re_ -= __c.real();
312 *this = *this * complex(__c.real(), __c.imag());
317 *this = *this / complex(__c.real(), __c.imag());
338 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR float real() const {return __re_;}
341 _LIBCPP_INLINE_VISIBILITY void real(value_type __re) {__re_ = __re;}
353 __re_ = __c.real();
359 __re_ += __c.real();
365 __re_ -= __c.real();
371 *this = *this * complex(__c.real(), __c.imag());
376 *this = *this / complex(__c.real(), __c.imag());
394 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR double real() const {return __re_;}
397 _LIBCPP_INLINE_VISIBILITY void real(value_type __re) {__re_ = __re;}
409 __re_ = __c.real();
415 __re_ += __c.real();
421 __re_ -= __c.real();
427 *this = *this * complex(__c.real(), __c.imag());
432 *this = *this / complex(__c.real(), __c.imag());
450 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR long double real() const {return __re_;}
453 _LIBCPP_INLINE_VISIBILITY void real(value_type __re) {__re_ = __re;}
465 __re_ = __c.real();
471 __re_ += __c.real();
477 __re_ -= __c.real();
483 *this = *this * complex(__c.real(), __c.imag());
488 *this = *this / complex(__c.real(), __c.imag());
496 : __re_(__c.real()), __im_(__c.imag()) {}
501 : __re_(__c.real()), __im_(__c.imag()) {}
506 : __re_(__c.real()), __im_(__c.imag()) {}
511 : __re_(__c.real()), __im_(__c.imag()) {}
516 : __re_(__c.real()), __im_(__c.imag()) {}
521 : __re_(__c.real()), __im_(__c.imag()) {}
589 _Tp __a = __z.real();
591 _Tp __c = __w.real();
669 _Tp __a = __z.real();
671 _Tp __c = __w.real();
713 return complex<_Tp>(__x.real() / __y, __x.imag() / __y);
739 return complex<_Tp>(-__x.real(), -__x.imag());
747 return __x.real() == __y.real() && __x.imag() == __y.imag();
755 return __x.real() == __y && __x.imag() == 0;
763 return __x == __y.real() && 0 == __y.imag();
792 // real
797 real(const complex<_Tp>& __c)
799 return __c.real();
804 real(long double __re)
811 real(double __re)
823 real(_Tp __re)
830 real(float __re)
885 return hypot(__c.real(), __c.imag());
895 return atan2(__c.imag(), __c.real());
938 if (isinf(__c.real()))
939 return abs(__c.real());
942 return __c.real() * __c.real() + __c.imag() * __c.imag();
985 return complex<_Tp>(__c.real(), -__c.imag());
1029 if (isinf(__c.real()) || isinf(__c.imag()))
1130 if (isinf(__x.real()))
1132 if (__x.real() > _Tp(0))
1133 … return complex<_Tp>(__x.real(), isnan(__x.imag()) ? __x.imag() : copysign(_Tp(0), __x.imag()));
1134 … return complex<_Tp>(isnan(__x.imag()) ? __x.imag() : _Tp(0), copysign(__x.real(), __x.imag()));
1146 if (isinf(__x.real()))
1148 if (__x.real() < _Tp(0))
1157 return complex<_Tp>(__x.real(), __i);
1160 else if (isnan(__x.real()) && __x.imag() == 0)
1162 _Tp __e = exp(__x.real());
1218 if (isinf(__x.real()))
1223 return complex<_Tp>(__x.real(), copysign(__pi * _Tp(0.25), __x.imag()));
1224 return complex<_Tp>(__x.real(), copysign(_Tp(0), __x.imag()));
1226 if (isnan(__x.real()))
1229 return complex<_Tp>(__x.imag(), __x.real());
1232 return complex<_Tp>(__x.real(), __x.real());
1235 return complex<_Tp>(copysign(__x.imag(), __x.real()), copysign(__pi/_Tp(2), __x.imag()));
1237 return complex<_Tp>(copysign(__z.real(), __x.real()), copysign(__z.imag(), __x.imag()));
1247 if (isinf(__x.real()))
1250 return complex<_Tp>(abs(__x.real()), __x.imag());
1253 if (__x.real() > 0)
1254 return complex<_Tp>(__x.real(), copysign(__pi * _Tp(0.25), __x.imag()));
1256 return complex<_Tp>(-__x.real(), copysign(__pi * _Tp(0.75), __x.imag()));
1258 if (__x.real() < 0)
1259 return complex<_Tp>(-__x.real(), copysign(__pi, __x.imag()));
1260 return complex<_Tp>(__x.real(), copysign(_Tp(0), __x.imag()));
1262 if (isnan(__x.real()))
1265 return complex<_Tp>(abs(__x.imag()), __x.real());
1266 return complex<_Tp>(__x.real(), __x.real());
1271 return complex<_Tp>(copysign(__z.real(), _Tp(0)), copysign(__z.imag(), __x.imag()));
1283 return complex<_Tp>(copysign(_Tp(0), __x.real()), copysign(__pi/_Tp(2), __x.imag()));
1287 if (isinf(__x.real()) || __x.real() == 0)
1288 return complex<_Tp>(copysign(_Tp(0), __x.real()), __x.imag());
1291 if (isnan(__x.real()))
1293 return complex<_Tp>(__x.real(), __x.real());
1295 if (isinf(__x.real()))
1297 return complex<_Tp>(copysign(_Tp(0), __x.real()), copysign(__pi/_Tp(2), __x.imag()));
1299 if (abs(__x.real()) == _Tp(1) && __x.imag() == _Tp(0))
1301 return complex<_Tp>(copysign(_Tp(INFINITY), __x.real()), copysign(_Tp(0), __x.imag()));
1304 return complex<_Tp>(copysign(__z.real(), __x.real()), copysign(__z.imag(), __x.imag()));
1313 if (isinf(__x.real()) && !isfinite(__x.imag()))
1314 return complex<_Tp>(__x.real(), _Tp(NAN));
1315 if (__x.real() == 0 && !isfinite(__x.imag()))
1316 return complex<_Tp>(__x.real(), _Tp(NAN));
1317 if (__x.imag() == 0 && !isfinite(__x.real()))
1319 return complex<_Tp>(sinh(__x.real()) * cos(__x.imag()), cosh(__x.real()) * sin(__x.imag()));
1328 if (isinf(__x.real()) && !isfinite(__x.imag()))
1329 return complex<_Tp>(abs(__x.real()), _Tp(NAN));
1330 if (__x.real() == 0 && !isfinite(__x.imag()))
1331 return complex<_Tp>(_Tp(NAN), __x.real());
1332 if (__x.real() == 0 && __x.imag() == 0)
1334 if (__x.imag() == 0 && !isfinite(__x.real()))
1335 return complex<_Tp>(abs(__x.real()), __x.imag());
1336 return complex<_Tp>(cosh(__x.real()) * cos(__x.imag()), sinh(__x.real()) * sin(__x.imag()));
1345 if (isinf(__x.real()))
1351 if (isnan(__x.real()) && __x.imag() == 0)
1353 _Tp __2r(_Tp(2) * __x.real());
1369 complex<_Tp> __z = asinh(complex<_Tp>(-__x.imag(), __x.real()));
1370 return complex<_Tp>(__z.imag(), -__z.real());
1380 if (isinf(__x.real()))
1383 return complex<_Tp>(__x.imag(), __x.real());
1386 if (__x.real() < _Tp(0))
1390 if (__x.real() < _Tp(0))
1391 return complex<_Tp>(__pi, signbit(__x.imag()) ? -__x.real() : __x.real());
1392 return complex<_Tp>(_Tp(0), signbit(__x.imag()) ? __x.real() : -__x.real());
1394 if (isnan(__x.real()))
1397 return complex<_Tp>(__x.real(), -__x.imag());
1398 return complex<_Tp>(__x.real(), __x.real());
1402 if (__x.real() == 0)
1406 return complex<_Tp>(abs(__z.imag()), abs(__z.real()));
1407 return complex<_Tp>(abs(__z.imag()), -abs(__z.real()));
1416 complex<_Tp> __z = atanh(complex<_Tp>(-__x.imag(), __x.real()));
1417 return complex<_Tp>(__z.imag(), -__z.real());
1426 complex<_Tp> __z = sinh(complex<_Tp>(-__x.imag(), __x.real()));
1427 return complex<_Tp>(__z.imag(), -__z.real());
1437 return cosh(complex<_Tp>(-__x.imag(), __x.real()));
1446 complex<_Tp> __z = tanh(complex<_Tp>(-__x.imag(), __x.real()));
1447 return complex<_Tp>(__z.imag(), -__z.real());
1520 __s << '(' << __x.real() << ',' << __x.imag() << ')';