Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

529 lines
24 KiB

  1. // xcomplex internal header
  2. // TEMPLATE FUNCTION imag
  3. _TMPLT(_Ty) inline
  4. _Ty __cdecl imag(const _CMPLX(_Ty)& _X)
  5. {return (_X.imag()); }
  6. // TEMPLATE FUNCTION real
  7. _TMPLT(_Ty) inline
  8. _Ty __cdecl real(const _CMPLX(_Ty)& _X)
  9. {return (_X.real()); }
  10. // TEMPLATE FUNCTION _Fabs
  11. _TMPLT(_Ty) inline
  12. _Ty __cdecl _Fabs(const _CMPLX(_Ty)& _X, int *_Pexp)
  13. {*_Pexp = 0;
  14. _Ty _A = real(_X);
  15. _Ty _B = imag(_X);
  16. if (_CTR(_Ty)::_Isnan(_A))
  17. return (_A);
  18. else if (_CTR(_Ty)::_Isnan(_B))
  19. return (_B);
  20. else
  21. {if (_A < 0)
  22. _A = -_A;
  23. if (_B < 0)
  24. _B = -_B;
  25. if (_A < _B)
  26. {_Ty _W = _A;
  27. _A = _B, _B = _W; }
  28. if (_A == 0 || _CTR(_Ty)::_Isinf(_A))
  29. return (_A);
  30. if (1 <= _A)
  31. *_Pexp = 2, _A = _A * 0.25, _B = _B * 0.25;
  32. else
  33. *_Pexp = -2, _A = _A * 4, _B = _B * 4;
  34. _Ty _W = _A - _B;
  35. if (_W == _A)
  36. return (_A);
  37. else if (_B < _W)
  38. {const _Ty _Q = _A / _B;
  39. return (_A + _B
  40. / (_Q + _CTR(_Ty)::sqrt(_Q * _Q + 1))); }
  41. else
  42. {static const _Ty _R2 = (const _Ty)1.4142135623730950488L;
  43. static const _Ty _Xh = (const _Ty)2.4142L;
  44. static const _Ty _Xl = (const _Ty)0.0000135623730950488016887L;
  45. const _Ty _Q = _W / _B;
  46. const _Ty _R = (_Q + 2) * _Q;
  47. const _Ty _S = _R / (_R2 + _CTR(_Ty)::sqrt(_R + 2))
  48. + _Xl + _Q + _Xh;
  49. return (_A + _B / _S); }}}
  50. // TEMPLATE FUNCTION operator+
  51. _TMPLT(_Ty) inline
  52. _CMPLX(_Ty) __cdecl operator+(const _CMPLX(_Ty)& _L,
  53. const _CMPLX(_Ty)& _R)
  54. {_CMPLX(_Ty) _W(_L);
  55. return (_W += _R); }
  56. _TMPLT(_Ty) inline
  57. _CMPLX(_Ty) __cdecl operator+(const _CMPLX(_Ty)& _L, const _Ty& _R)
  58. {_CMPLX(_Ty) _W(_L);
  59. _W.real(_W.real() + _R);
  60. return (_W); }
  61. _TMPLT(_Ty) inline
  62. _CMPLX(_Ty) __cdecl operator+(const _Ty& _L, const _CMPLX(_Ty)& _R)
  63. {_CMPLX(_Ty) _W(_L);
  64. return (_W += _R); }
  65. // TEMPLATE FUNCTION operator-
  66. _TMPLT(_Ty) inline
  67. _CMPLX(_Ty) __cdecl operator-(const _CMPLX(_Ty)& _L,
  68. const _CMPLX(_Ty)& _R)
  69. {_CMPLX(_Ty) _W(_L);
  70. return (_W -= _R); }
  71. _TMPLT(_Ty) inline
  72. _CMPLX(_Ty) __cdecl operator-(const _CMPLX(_Ty)& _L, const _Ty& _R)
  73. {_CMPLX(_Ty) _W(_L);
  74. _W.real(_W.real() - _R);
  75. return (_W); }
  76. _TMPLT(_Ty) inline
  77. _CMPLX(_Ty) __cdecl operator-(const _Ty& _L, const _CMPLX(_Ty)& _R)
  78. {_CMPLX(_Ty) _W(_L);
  79. return (_W -= _R); }
  80. // TEMPLATE FUNCTION operator*
  81. _TMPLT(_Ty) inline
  82. _CMPLX(_Ty) __cdecl operator*(const _CMPLX(_Ty)& _L,
  83. const _CMPLX(_Ty)& _R)
  84. {_CMPLX(_Ty) _W(_L);
  85. return (_W *= _R); }
  86. _TMPLT(_Ty) inline
  87. _CMPLX(_Ty) __cdecl operator*(const _CMPLX(_Ty)& _L, const _Ty& _R)
  88. {_CMPLX(_Ty) _W(_L);
  89. _W.real(_W.real() * _R);
  90. _W.imag(_W.imag() * _R);
  91. return (_W); }
  92. _TMPLT(_Ty) inline
  93. _CMPLX(_Ty) __cdecl operator*(const _Ty& _L, const _CMPLX(_Ty)& _R)
  94. {_CMPLX(_Ty) _W(_L);
  95. return (_W *= _R); }
  96. // TEMPLATE FUNCTION operator/
  97. _TMPLT(_Ty) inline
  98. _CMPLX(_Ty) __cdecl operator/(const _CMPLX(_Ty)& _L,
  99. const _CMPLX(_Ty)& _R)
  100. {_CMPLX(_Ty) _W(_L);
  101. return (_W /= _R); }
  102. _TMPLT(_Ty) inline
  103. _CMPLX(_Ty) __cdecl operator/(const _CMPLX(_Ty)& _L, const _Ty& _R)
  104. {_CMPLX(_Ty) _W(_L);
  105. _W.real(_W.real() / _R);
  106. _W.imag(_W.imag() / _R);
  107. return (_W); }
  108. _TMPLT(_Ty) inline
  109. _CMPLX(_Ty) __cdecl operator/(const _Ty& _L, const _CMPLX(_Ty)& _R)
  110. {_CMPLX(_Ty) _W(_L);
  111. return (_W /= _R); }
  112. // TEMPLATE FUNCTION UNARY operator+
  113. _TMPLT(_Ty) inline
  114. _CMPLX(_Ty) __cdecl operator+(const _CMPLX(_Ty)& _L)
  115. {return (_CMPLX(_Ty)(_L)); }
  116. // TEMPLATE FUNCTION UNARY operator-
  117. _TMPLT(_Ty) inline
  118. _CMPLX(_Ty) __cdecl operator-(const _CMPLX(_Ty)& _L)
  119. {return (_CMPLX(_Ty)(-real(_L), -imag(_L))); }
  120. // TEMPLATE FUNCTION operator==
  121. _TMPLT(_Ty) inline
  122. bool __cdecl operator==(const _CMPLX(_Ty)& _L, const _CMPLX(_Ty)& _R)
  123. {return (real(_L) == real(_R) && imag(_L) == imag(_R)); }
  124. _TMPLT(_Ty) inline
  125. bool __cdecl operator==(const _CMPLX(_Ty)& _L, const _Ty& _R)
  126. {return (real(_L) == _R && imag(_L) == 0); }
  127. _TMPLT(_Ty) inline
  128. bool __cdecl operator==(const _Ty& _L, const _CMPLX(_Ty)& _R)
  129. {return (_L == real(_R) && 0 == imag(_R)); }
  130. _TMPLT(_Ty) inline
  131. bool __cdecl operator!=(const _CMPLX(_Ty)& _L, const _CMPLX(_Ty)& _R)
  132. {return (!(_L == _R)); }
  133. _TMPLT(_Ty) inline
  134. bool __cdecl operator!=(const _CMPLX(_Ty)& _L, const _Ty& _R)
  135. {return (!(_L == _R)); }
  136. _TMPLT(_Ty) inline
  137. bool __cdecl operator!=(const _Ty& _L, const _CMPLX(_Ty)& _R)
  138. {return (!(_L == _R)); }
  139. // TEMPLATE FUNCTION abs
  140. _TMPLT(_Ty) inline
  141. _Ty __cdecl abs(const _CMPLX(_Ty)& _X)
  142. {int _Xexp;
  143. _Ty _Rho = _Fabs(_X, &_Xexp);
  144. if (_Xexp == 0)
  145. return (_Rho);
  146. else
  147. return (_CTR(_Ty)::ldexp(_Rho, _Xexp)); }
  148. // TEMPLATE FUNCTION arg
  149. _TMPLT(_Ty) inline
  150. _Ty __cdecl arg(const _CMPLX(_Ty)& _X)
  151. {return (_CTR(_Ty)::atan2(imag(_X), real(_X))); }
  152. // TEMPLATE FUNCTION conjg
  153. _TMPLT(_Ty) inline
  154. _CMPLX(_Ty) __cdecl conj(const _CMPLX(_Ty)& _X)
  155. {return (_CMPLX(_Ty)(real(_X), -imag(_X))); }
  156. // TEMPLATE FUNCTION cos
  157. _TMPLT(_Ty) inline
  158. _CMPLX(_Ty) __cdecl cos(const _CMPLX(_Ty)& _X)
  159. {return (_CMPLX(_Ty)(
  160. _CTR(_Ty)::_Cosh(imag(_X), _CTR(_Ty)::cos(real(_X))),
  161. -_CTR(_Ty)::_Sinh(imag(_X),
  162. _CTR(_Ty)::sin(real(_X))))); }
  163. // TEMPLATE FUNCTION cosh
  164. _TMPLT(_Ty) inline
  165. _CMPLX(_Ty) __cdecl cosh(const _CMPLX(_Ty)& _X)
  166. {return (_CMPLX(_Ty)(
  167. _CTR(_Ty)::_Cosh(real(_X), _CTR(_Ty)::cos(imag(_X))),
  168. _CTR(_Ty)::_Sinh(real(_X), _CTR(_Ty)::sin(imag(_X))))); }
  169. // TEMPLATE FUNCTION exp
  170. _TMPLT(_Ty) inline
  171. _CMPLX(_Ty) __cdecl exp(const _CMPLX(_Ty)& _X)
  172. {_Ty _Re(real(_X)), _Im(real(_X));
  173. _CTR(_Ty)::_Exp(&_Re, _CTR(_Ty)::cos(imag(_X)), 0);
  174. _CTR(_Ty)::_Exp(&_Im, _CTR(_Ty)::sin(imag(_X)), 0);
  175. return (_CMPLX(_Ty)(_Re, _Im)); }
  176. // TEMPLATE FUNCTION log
  177. _TMPLT(_Ty) inline
  178. _CMPLX(_Ty) __cdecl log(const _CMPLX(_Ty)& _X)
  179. {int _Xexp;
  180. _Ty _Rho = _Fabs(_X, &_Xexp);
  181. if (_CTR(_Ty)::_Isnan(_Rho))
  182. return (_CMPLX(_Ty)(_Rho, _Rho));
  183. else
  184. {static const _Ty _Cm = 22713.0 / 32768.0;
  185. static const _Ty _Cl = (const _Ty)1.428606820309417232e-6L;
  186. _Ty _Xn = _Xexp;
  187. _CMPLX(_Ty) _W(_Rho == 0 ? -_CTR(_Ty)::_Infv(_Rho)
  188. : _CTR(_Ty)::_Isinf(_Rho) ? _Rho
  189. : _CTR(_Ty)::log(_Rho) + _Xn * _Cl + _Xn * _Cm,
  190. _CTR(_Ty)::atan2(imag(_X), real(_X)));
  191. return (_W); }}
  192. // TEMPLATE FUNCTION log10
  193. _TMPLT(_Ty) inline
  194. _CMPLX(_Ty) __cdecl log10(const _CMPLX(_Ty)& _X)
  195. {return (log(_X) * (_Ty)0.4342944819032518276511289L); }
  196. // TEMPLATE FUNCTION norm
  197. _TMPLT(_Ty) inline
  198. _Ty __cdecl norm(const _CMPLX(_Ty)& _X)
  199. {return (real(_X) * real(_X) + imag(_X) * imag(_X)); }
  200. // TEMPLATE FUNCTION polar
  201. _TMPLT(_Ty) inline
  202. _CMPLX(_Ty) __cdecl polar(const _Ty& _Rho, const _Ty& _Theta)
  203. {return (_CMPLX(_Ty)(_Rho * _CTR(_Ty)::cos(_Theta),
  204. _Rho * _CTR(_Ty)::sin(_Theta))); }
  205. _TMPLT(_Ty) inline
  206. _CMPLX(_Ty) __cdecl polar(const _Ty& _Rho)
  207. {return (polar(_Rho, (_Ty)0)); }
  208. // TEMPLATE FUNCTION pow
  209. _TMPLT(_Ty) inline
  210. _CMPLX(_Ty) __cdecl pow(const _CMPLX(_Ty)& _X,
  211. const _CMPLX(_Ty)& _Y)
  212. {if (imag(_Y) == 0)
  213. return (pow(_X, real(_Y)));
  214. else if (imag(_X) == 0)
  215. return (_CMPLX(_Ty)(pow(real(_X), _Y)));
  216. else
  217. return (exp(_Y * log(_X))); }
  218. _TMPLT(_Ty) inline
  219. _CMPLX(_Ty) __cdecl pow(const _CMPLX(_Ty)& _X, const _Ty& _Y)
  220. {if (imag(_X) == 0)
  221. return (_CMPLX(_Ty)(_CTR(_Ty)::pow(real(_X), _Y)));
  222. else
  223. return (exp(_Y * log(_X))); }
  224. _TMPLT(_Ty) inline
  225. _CMPLX(_Ty) __cdecl pow(const _CMPLX(_Ty)& _X, int _Y)
  226. {if (imag(_X) == 0)
  227. return (_CMPLX(_Ty)(_CTR(_Ty)::pow(real(_X), _Y)));
  228. else
  229. return (_Pow_int(_CMPLX(_Ty)(_X), _Y)); }
  230. _TMPLT(_Ty) inline
  231. _CMPLX(_Ty) __cdecl pow(const _Ty& _X, const _CMPLX(_Ty)& _Y)
  232. {if (imag(_Y) == 0)
  233. return (_CMPLX(_Ty)(_CTR(_Ty)::pow(_X, real(_Y))));
  234. else
  235. return (exp(_Y * _CTR(_Ty)::log(_X))); }
  236. // TEMPLATE FUNCTION sin
  237. _TMPLT(_Ty) inline
  238. _CMPLX(_Ty) __cdecl sin(const _CMPLX(_Ty)& _X)
  239. {return (_CMPLX(_Ty)(
  240. _CTR(_Ty)::_Cosh(imag(_X), _CTR(_Ty)::sin(real(_X))),
  241. _CTR(_Ty)::_Sinh(imag(_X), _CTR(_Ty)::cos(real(_X))))); }
  242. // TEMPLATE FUNCTION sinh
  243. _TMPLT(_Ty) inline
  244. _CMPLX(_Ty) __cdecl sinh(const _CMPLX(_Ty)& _X)
  245. {return (_CMPLX(_Ty)(
  246. _CTR(_Ty)::_Sinh(real(_X), _CTR(_Ty)::cos(imag(_X))),
  247. _CTR(_Ty)::_Cosh(real(_X), _CTR(_Ty)::sin(imag(_X))))); }
  248. // TEMPLATE FUNCTION sqrt
  249. _TMPLT(_Ty) inline
  250. _CMPLX(_Ty) __cdecl sqrt(const _CMPLX(_Ty)& _X)
  251. {int _Xexp;
  252. _Ty _Rho = _Fabs(_X, &_Xexp);
  253. if (_Xexp == 0)
  254. return (_CMPLX(_Ty)(_Rho, _Rho));
  255. else
  256. {_Ty _Remag = _CTR(_Ty)::ldexp(real(_X) < 0
  257. ? - real(_X) : real(_X), -_Xexp);
  258. _Rho = _CTR(_Ty)::ldexp(_CTR(_Ty)::sqrt(
  259. 2 * (_Remag + _Rho)), _Xexp / 2 - 1);
  260. if (0 <= real(_X))
  261. return (_CMPLX(_Ty)(_Rho, imag(_X) / (2 * _Rho)));
  262. else if (imag(_X) < 0)
  263. return (_CMPLX(_Ty)(-imag(_X) / (2 * _Rho), -_Rho));
  264. else
  265. return (_CMPLX(_Ty)(imag(_X) / (2 * _Rho),
  266. _Rho)); }}
  267. #ifdef _DLL
  268. #ifndef CRTDLL2
  269. #pragma warning(disable:4231) /* the extern before template is a non-standard extension */
  270. extern template _CRTIMP2 complex<float>& __cdecl operator+=(
  271. complex<float>&, const complex<float>&);
  272. extern template _CRTIMP2 complex<float>& __cdecl operator-=(
  273. complex<float>&, const complex<float>&);
  274. extern template _CRTIMP2 complex<float>& __cdecl operator*=(
  275. complex<float>&, const complex<float>&);
  276. extern template _CRTIMP2 complex<float>& __cdecl operator/=(
  277. complex<float>&, const complex<float>&);
  278. extern template _CRTIMP2 basic_istream<char, char_traits<char> >& __cdecl operator>>(
  279. basic_istream<char, char_traits<char> >&, complex<float>&);
  280. extern template _CRTIMP2 basic_ostream<char, char_traits<char> >& __cdecl operator<<(
  281. basic_ostream<char, char_traits<char> >&, const complex<float>&);
  282. extern template _CRTIMP2 basic_istream<wchar_t, char_traits<wchar_t> >& __cdecl operator>>(
  283. basic_istream<wchar_t, char_traits<wchar_t> >&, complex<float>&);
  284. extern template _CRTIMP2 basic_ostream<wchar_t, char_traits<wchar_t> >& __cdecl operator<<(
  285. basic_ostream<wchar_t, char_traits<wchar_t> >&, const complex<float>&);
  286. extern template _CRTIMP2 complex<double>& __cdecl operator+=(
  287. complex<double>&, const complex<double>&);
  288. extern template _CRTIMP2 complex<double>& __cdecl operator-=(
  289. complex<double>&, const complex<double>&);
  290. extern template _CRTIMP2 complex<double>& __cdecl operator*=(
  291. complex<double>&, const complex<double>&);
  292. extern template _CRTIMP2 complex<double>& __cdecl operator/=(
  293. complex<double>&, const complex<double>&);
  294. extern template _CRTIMP2 basic_istream<char, char_traits<char> >& __cdecl operator>>(
  295. basic_istream<char, char_traits<char> >&, complex<double>&);
  296. extern template _CRTIMP2 basic_ostream<char, char_traits<char> >& __cdecl operator<<(
  297. basic_ostream<char, char_traits<char> >&, const complex<double>&);
  298. extern template _CRTIMP2 basic_istream<wchar_t, char_traits<wchar_t> >& __cdecl operator>>(
  299. basic_istream<wchar_t, char_traits<wchar_t> >&, complex<double>&);
  300. extern template _CRTIMP2 basic_ostream<wchar_t, char_traits<wchar_t> >& __cdecl operator<<(
  301. basic_ostream<wchar_t, char_traits<wchar_t> >&, const complex<double>&);
  302. extern template _CRTIMP2 complex<long double>& __cdecl operator+=(
  303. complex<long double>&, const complex<long double>&);
  304. extern template _CRTIMP2 complex<long double>& __cdecl operator-=(
  305. complex<long double>&, const complex<long double>&);
  306. extern template _CRTIMP2 complex<long double>& __cdecl operator*=(
  307. complex<long double>&, const complex<long double>&);
  308. extern template _CRTIMP2 complex<long double>& __cdecl operator/=(
  309. complex<long double>&, const complex<long double>&);
  310. extern template _CRTIMP2 basic_istream<char, char_traits<char> >& __cdecl operator>>(
  311. basic_istream<char, char_traits<char> >&, complex<long double>&);
  312. extern template _CRTIMP2 basic_ostream<char, char_traits<char> >& __cdecl operator<<(
  313. basic_ostream<char, char_traits<char> >&, const complex<long double>&);
  314. extern template _CRTIMP2 basic_istream<wchar_t, char_traits<wchar_t> >& __cdecl operator>>(
  315. basic_istream<wchar_t, char_traits<wchar_t> >&, complex<long double>&);
  316. extern template _CRTIMP2 basic_ostream<wchar_t, char_traits<wchar_t> >& __cdecl operator<<(
  317. basic_ostream<wchar_t, char_traits<wchar_t> >&, const complex<long double>&);
  318. extern template _CRTIMP2 float __cdecl imag(const complex<float>&);
  319. extern template _CRTIMP2 float __cdecl real(const complex<float>&);
  320. extern template _CRTIMP2 float __cdecl _Fabs(const complex<float>&, int *);
  321. extern template _CRTIMP2 complex<float> __cdecl operator+(
  322. const complex<float>&, const complex<float>&);
  323. extern template _CRTIMP2 complex<float> __cdecl operator+(
  324. const complex<float>&, const float&);
  325. extern template _CRTIMP2 complex<float> __cdecl operator+(
  326. const float&, const complex<float>&);
  327. extern template _CRTIMP2 complex<float> __cdecl operator-(
  328. const complex<float>&, const complex<float>&);
  329. extern template _CRTIMP2 complex<float> __cdecl operator-(
  330. const complex<float>&, const float&);
  331. extern template _CRTIMP2 complex<float> __cdecl operator-(
  332. const float&, const complex<float>&);
  333. extern template _CRTIMP2 complex<float> __cdecl operator*(
  334. const complex<float>&, const complex<float>&);
  335. extern template _CRTIMP2 complex<float> __cdecl operator*(
  336. const complex<float>&, const float&);
  337. extern template _CRTIMP2 complex<float> __cdecl operator*(
  338. const float&, const complex<float>&);
  339. extern template _CRTIMP2 complex<float> __cdecl operator/(
  340. const complex<float>&, const complex<float>&);
  341. extern template _CRTIMP2 complex<float> __cdecl operator/(
  342. const complex<float>&, const float&);
  343. extern template _CRTIMP2 complex<float> __cdecl operator/(
  344. const float&, const complex<float>&);
  345. extern template _CRTIMP2 complex<float> __cdecl operator+(
  346. const complex<float>&);
  347. extern template _CRTIMP2 complex<float> __cdecl operator-(
  348. const complex<float>&);
  349. extern template _CRTIMP2 bool __cdecl operator==(
  350. const complex<float>&, const complex<float>&);
  351. extern template _CRTIMP2 bool __cdecl operator==(
  352. const complex<float>&, const float&);
  353. extern template _CRTIMP2 bool __cdecl operator==(
  354. const float&, const complex<float>&);
  355. extern template _CRTIMP2 bool __cdecl operator!=(
  356. const complex<float>&, const complex<float>&);
  357. extern template _CRTIMP2 bool __cdecl operator!=(
  358. const complex<float>&, const float&);
  359. extern template _CRTIMP2 bool __cdecl operator!=(
  360. const float&, const complex<float>&);
  361. extern template _CRTIMP2 float __cdecl abs(const complex<float>&);
  362. extern template _CRTIMP2 float __cdecl arg(const complex<float>&);
  363. extern template _CRTIMP2 complex<float> __cdecl conj(const complex<float>&);
  364. extern template _CRTIMP2 complex<float> __cdecl cos(const complex<float>&);
  365. extern template _CRTIMP2 complex<float> __cdecl cosh(const complex<float>&);
  366. extern template _CRTIMP2 complex<float> __cdecl exp(const complex<float>&);
  367. extern template _CRTIMP2 complex<float> __cdecl log(const complex<float>&);
  368. extern template _CRTIMP2 complex<float> __cdecl log10(const complex<float>&);
  369. extern template _CRTIMP2 float __cdecl norm(const complex<float>&);
  370. extern template _CRTIMP2 complex<float> __cdecl polar(const float&, const float&);
  371. extern template _CRTIMP2 complex<float> __cdecl polar(const float&);
  372. extern template _CRTIMP2 complex<float> __cdecl pow(
  373. const complex<float>&, const complex<float>&);
  374. extern template _CRTIMP2 complex<float> __cdecl pow(
  375. const complex<float>&, const float&);
  376. extern template _CRTIMP2 complex<float> __cdecl pow(
  377. const complex<float>&, int);
  378. extern template _CRTIMP2 complex<float> __cdecl pow(
  379. const float&, const complex<float>&);
  380. extern template _CRTIMP2 complex<float> __cdecl sin(const complex<float>&);
  381. extern template _CRTIMP2 complex<float> __cdecl sinh(const complex<float>&);
  382. extern template _CRTIMP2 complex<float> __cdecl sqrt(const complex<float>&);
  383. extern template _CRTIMP2 double __cdecl imag(const complex<double>&);
  384. extern template _CRTIMP2 double __cdecl real(const complex<double>&);
  385. extern template _CRTIMP2 double __cdecl _Fabs(const complex<double>&, int *);
  386. extern template _CRTIMP2 complex<double> __cdecl operator+(
  387. const complex<double>&, const complex<double>&);
  388. extern template _CRTIMP2 complex<double> __cdecl operator+(
  389. const complex<double>&, const double&);
  390. extern template _CRTIMP2 complex<double> __cdecl operator+(
  391. const double&, const complex<double>&);
  392. extern template _CRTIMP2 complex<double> __cdecl operator-(
  393. const complex<double>&, const complex<double>&);
  394. extern template _CRTIMP2 complex<double> __cdecl operator-(
  395. const complex<double>&, const double&);
  396. extern template _CRTIMP2 complex<double> __cdecl operator-(
  397. const double&, const complex<double>&);
  398. extern template _CRTIMP2 complex<double> __cdecl operator*(
  399. const complex<double>&, const complex<double>&);
  400. extern template _CRTIMP2 complex<double> __cdecl operator*(
  401. const complex<double>&, const double&);
  402. extern template _CRTIMP2 complex<double> __cdecl operator*(
  403. const double&, const complex<double>&);
  404. extern template _CRTIMP2 complex<double> __cdecl operator/(
  405. const complex<double>&, const complex<double>&);
  406. extern template _CRTIMP2 complex<double> __cdecl operator/(
  407. const complex<double>&, const double&);
  408. extern template _CRTIMP2 complex<double> __cdecl operator/(
  409. const double&, const complex<double>&);
  410. extern template _CRTIMP2 complex<double> __cdecl operator+(
  411. const complex<double>&);
  412. extern template _CRTIMP2 complex<double> __cdecl operator-(
  413. const complex<double>&);
  414. extern template _CRTIMP2 bool __cdecl operator==(
  415. const complex<double>&, const complex<double>&);
  416. extern template _CRTIMP2 bool __cdecl operator==(
  417. const complex<double>&, const double&);
  418. extern template _CRTIMP2 bool __cdecl operator==(
  419. const double&, const complex<double>&);
  420. extern template _CRTIMP2 bool __cdecl operator!=(
  421. const complex<double>&, const complex<double>&);
  422. extern template _CRTIMP2 bool __cdecl operator!=(
  423. const complex<double>&, const double&);
  424. extern template _CRTIMP2 bool __cdecl operator!=(
  425. const double&, const complex<double>&);
  426. extern template _CRTIMP2 double __cdecl abs(const complex<double>&);
  427. extern template _CRTIMP2 double __cdecl arg(const complex<double>&);
  428. extern template _CRTIMP2 complex<double> __cdecl conj(const complex<double>&);
  429. extern template _CRTIMP2 complex<double> __cdecl cos(const complex<double>&);
  430. extern template _CRTIMP2 complex<double> __cdecl cosh(const complex<double>&);
  431. extern template _CRTIMP2 complex<double> __cdecl exp(const complex<double>&);
  432. extern template _CRTIMP2 complex<double> __cdecl log(const complex<double>&);
  433. extern template _CRTIMP2 complex<double> __cdecl log10(const complex<double>&);
  434. extern template _CRTIMP2 double __cdecl norm(const complex<double>&);
  435. extern template _CRTIMP2 complex<double> __cdecl polar(const double&, const double&);
  436. extern template _CRTIMP2 complex<double> __cdecl polar(const double&);
  437. extern template _CRTIMP2 complex<double> __cdecl pow(
  438. const complex<double>&, const complex<double>&);
  439. extern template _CRTIMP2 complex<double> __cdecl pow(
  440. const complex<double>&, const double&);
  441. extern template _CRTIMP2 complex<double> __cdecl pow(
  442. const complex<double>&, int);
  443. extern template _CRTIMP2 complex<double> __cdecl pow(
  444. const double&, const complex<double>&);
  445. extern template _CRTIMP2 complex<double> __cdecl sin(const complex<double>&);
  446. extern template _CRTIMP2 complex<double> __cdecl sinh(const complex<double>&);
  447. extern template _CRTIMP2 complex<double> __cdecl sqrt(const complex<double>&);
  448. extern template _CRTIMP2 long double __cdecl imag(const complex<long double>&);
  449. extern template _CRTIMP2 long double __cdecl real(const complex<long double>&);
  450. extern template _CRTIMP2 long double __cdecl _Fabs(const complex<long double>&, int *);
  451. extern template _CRTIMP2 complex<long double> __cdecl operator+(
  452. const complex<long double>&, const complex<long double>&);
  453. extern template _CRTIMP2 complex<long double> __cdecl operator+(
  454. const complex<long double>&, const long double&);
  455. extern template _CRTIMP2 complex<long double> __cdecl operator+(
  456. const long double&, const complex<long double>&);
  457. extern template _CRTIMP2 complex<long double> __cdecl operator-(
  458. const complex<long double>&, const complex<long double>&);
  459. extern template _CRTIMP2 complex<long double> __cdecl operator-(
  460. const complex<long double>&, const long double&);
  461. extern template _CRTIMP2 complex<long double> __cdecl operator-(
  462. const long double&, const complex<long double>&);
  463. extern template _CRTIMP2 complex<long double> __cdecl operator*(
  464. const complex<long double>&, const complex<long double>&);
  465. extern template _CRTIMP2 complex<long double> __cdecl operator*(
  466. const complex<long double>&, const long double&);
  467. extern template _CRTIMP2 complex<long double> __cdecl operator*(
  468. const long double&, const complex<long double>&);
  469. extern template _CRTIMP2 complex<long double> __cdecl operator/(
  470. const complex<long double>&, const complex<long double>&);
  471. extern template _CRTIMP2 complex<long double> __cdecl operator/(
  472. const complex<long double>&, const long double&);
  473. extern template _CRTIMP2 complex<long double> __cdecl operator/(
  474. const long double&, const complex<long double>&);
  475. extern template _CRTIMP2 complex<long double> __cdecl operator+(
  476. const complex<long double>&);
  477. extern template _CRTIMP2 complex<long double> __cdecl operator-(
  478. const complex<long double>&);
  479. extern template _CRTIMP2 bool __cdecl operator==(
  480. const complex<long double>&, const complex<long double>&);
  481. extern template _CRTIMP2 bool __cdecl operator==(
  482. const complex<long double>&, const long double&);
  483. extern template _CRTIMP2 bool __cdecl operator==(
  484. const long double&, const complex<long double>&);
  485. extern template _CRTIMP2 bool __cdecl operator!=(
  486. const complex<long double>&, const complex<long double>&);
  487. extern template _CRTIMP2 bool __cdecl operator!=(
  488. const complex<long double>&, const long double&);
  489. extern template _CRTIMP2 bool __cdecl operator!=(
  490. const long double&, const complex<long double>&);
  491. extern template _CRTIMP2 long double __cdecl abs(const complex<long double>&);
  492. extern template _CRTIMP2 long double __cdecl arg(const complex<long double>&);
  493. extern template _CRTIMP2 complex<long double> __cdecl conj(const complex<long double>&);
  494. extern template _CRTIMP2 complex<long double> __cdecl cos(const complex<long double>&);
  495. extern template _CRTIMP2 complex<long double> __cdecl cosh(const complex<long double>&);
  496. extern template _CRTIMP2 complex<long double> __cdecl exp(const complex<long double>&);
  497. extern template _CRTIMP2 complex<long double> __cdecl log(const complex<long double>&);
  498. extern template _CRTIMP2 complex<long double> __cdecl log10(const complex<long double>&);
  499. extern template _CRTIMP2 long double __cdecl norm(const complex<long double>&);
  500. extern template _CRTIMP2 complex<long double> __cdecl polar(const long double&, const long double&);
  501. extern template _CRTIMP2 complex<long double> __cdecl polar(const long double&);
  502. extern template _CRTIMP2 complex<long double> __cdecl pow(
  503. const complex<long double>&, const complex<long double>&);
  504. extern template _CRTIMP2 complex<long double> __cdecl pow(
  505. const complex<long double>&, const long double&);
  506. extern template _CRTIMP2 complex<long double> __cdecl pow(
  507. const complex<long double>&, int);
  508. extern template _CRTIMP2 complex<long double> __cdecl pow(
  509. const long double&, const complex<long double>&);
  510. extern template _CRTIMP2 complex<long double> __cdecl sin(const complex<long double>&);
  511. extern template _CRTIMP2 complex<long double> __cdecl sinh(const complex<long double>&);
  512. extern template _CRTIMP2 complex<long double> __cdecl sqrt(const complex<long double>&);
  513. #pragma warning(default:4231) /* restore previous warning */
  514. #endif // CRTDLL2
  515. #endif // _DLL
  516. /*
  517. * Copyright (c) 1996 by P.J. Plauger. ALL RIGHTS RESERVED.
  518. * Consult your license regarding permissions and restrictions.
  519. */