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.

741 lines
23 KiB

  1. // xcomplex internal header
  2. #pragma once
  3. #ifndef _XCOMPLEX_
  4. #define _XCOMPLEX_
  5. // TEMPLATE FUNCTION imag
  6. _TMPLT(_Ty) inline
  7. _Ty __cdecl imag(const _CMPLX(_Ty)& _Left)
  8. { // return imaginary component
  9. return (_Left.imag());
  10. }
  11. // TEMPLATE FUNCTION real
  12. _TMPLT(_Ty) inline
  13. _Ty __cdecl real(const _CMPLX(_Ty)& _Left)
  14. { // return real component
  15. return (_Left.real());
  16. }
  17. // TEMPLATE FUNCTION _Fabs
  18. _TMPLT(_Ty) inline
  19. _Ty __cdecl _Fabs(const _CMPLX(_Ty)& _Left, int *_Pexp)
  20. { // return magnitude and scale factor
  21. *_Pexp = 0;
  22. _Ty _Av = real(_Left);
  23. _Ty _Bv = imag(_Left);
  24. if (_CTR(_Ty)::_Isinf(_Av) || _CTR(_Ty)::_Isinf(_Bv))
  25. return (_CTR(_Ty)::_Infv(_Bv)); // at least one component is INF
  26. else if (_CTR(_Ty)::_Isnan(_Av))
  27. return (_Av); // real component is NaN
  28. else if (_CTR(_Ty)::_Isnan(_Bv))
  29. return (_Bv); // imaginary component is NaN
  30. else
  31. { // neither component is NaN or INF
  32. if (_Av < 0)
  33. _Av = -_Av;
  34. if (_Bv < 0)
  35. _Bv = -_Bv;
  36. if (_Av < _Bv)
  37. { // ensure that |_Bv| <= |_Av|
  38. _Ty _Tmp = _Av;
  39. _Av = _Bv;
  40. _Bv = _Tmp;
  41. }
  42. if (_Av == 0)
  43. return (_Av); // |0| == 0
  44. if (1 <= _Av)
  45. *_Pexp = 2, _Av = _Av * (_Ty)0.25, _Bv = _Bv * (_Ty)0.25;
  46. else
  47. *_Pexp = -2, _Av = _Av * 4, _Bv = _Bv * 4;
  48. _Ty _Tmp = _Av - _Bv;
  49. if (_Tmp == _Av)
  50. return (_Av); // _Bv unimportant
  51. else if (_Bv < _Tmp)
  52. { // use simple approximation
  53. const _Ty _Qv = _Av / _Bv;
  54. return (_Av + _Bv / (_Qv + _CTR(_Ty)::sqrt(_Qv * _Qv + 1)));
  55. }
  56. else
  57. { // use 1 1/2 precision to preserve bits
  58. static const _Ty _Root2 =
  59. (_Ty)1.4142135623730950488016887242096981L;
  60. static const _Ty _Oneplusroot2high = (_Ty)2.4142L;
  61. static const _Ty _Oneplusroot2low =
  62. (_Ty)0.0000135623730950488016887242096980785697L;
  63. const _Ty _Qv = _Tmp / _Bv;
  64. const _Ty _Rv = (_Qv + 2) * _Qv;
  65. const _Ty _Sv = _Rv / (_Root2 + _CTR(_Ty)::sqrt(_Rv + 2))
  66. + _Oneplusroot2low + _Qv + _Oneplusroot2high;
  67. return (_Av + _Bv / _Sv);
  68. }
  69. }
  70. }
  71. // TEMPLATE FUNCTION operator+
  72. _TMPLT(_Ty) inline
  73. _CMPLX(_Ty) __cdecl operator+(const _CMPLX(_Ty)& _Left,
  74. const _CMPLX(_Ty)& _Right)
  75. { // add complex to complex
  76. _CMPLX(_Ty) _Tmp(_Left);
  77. return (_Tmp += _Right);
  78. }
  79. _TMPLT(_Ty) inline
  80. _CMPLX(_Ty) __cdecl operator+(const _CMPLX(_Ty)& _Left,
  81. const _Ty& _Right)
  82. { // add real to complex
  83. _CMPLX(_Ty) _Tmp(_Left);
  84. _Tmp.real(_Tmp.real() + _Right);
  85. return (_Tmp);
  86. }
  87. _TMPLT(_Ty) inline
  88. _CMPLX(_Ty) __cdecl operator+(const _Ty& _Left,
  89. const _CMPLX(_Ty)& _Right)
  90. { // add complex to real
  91. _CMPLX(_Ty) _Tmp(_Left);
  92. return (_Tmp += _Right);
  93. }
  94. // TEMPLATE FUNCTION operator-
  95. _TMPLT(_Ty) inline
  96. _CMPLX(_Ty) __cdecl operator-(const _CMPLX(_Ty)& _Left,
  97. const _CMPLX(_Ty)& _Right)
  98. { // subtract complex from complex
  99. _CMPLX(_Ty) _Tmp(_Left);
  100. return (_Tmp -= _Right);
  101. }
  102. _TMPLT(_Ty) inline
  103. _CMPLX(_Ty) __cdecl operator-(const _CMPLX(_Ty)& _Left,
  104. const _Ty& _Right)
  105. { // subtract real from complex
  106. _CMPLX(_Ty) _Tmp(_Left);
  107. _Tmp.real(_Tmp.real() - _Right);
  108. return (_Tmp);
  109. }
  110. _TMPLT(_Ty) inline
  111. _CMPLX(_Ty) __cdecl operator-(const _Ty& _Left,
  112. const _CMPLX(_Ty)& _Right)
  113. { // subtract complex from real
  114. _CMPLX(_Ty) _Tmp(_Left);
  115. return (_Tmp -= _Right);
  116. }
  117. // TEMPLATE FUNCTION operator*
  118. _TMPLT(_Ty) inline
  119. _CMPLX(_Ty) __cdecl operator*(const _CMPLX(_Ty)& _Left,
  120. const _CMPLX(_Ty)& _Right)
  121. { // multiply complex by complex
  122. _CMPLX(_Ty) _Tmp(_Left);
  123. return (_Tmp *= _Right);
  124. }
  125. _TMPLT(_Ty) inline
  126. _CMPLX(_Ty) __cdecl operator*(const _CMPLX(_Ty)& _Left,
  127. const _Ty& _Right)
  128. { // multiply complex by real
  129. _CMPLX(_Ty) _Tmp(_Left);
  130. _Tmp.real(_Tmp.real() * _Right);
  131. _Tmp.imag(_Tmp.imag() * _Right);
  132. return (_Tmp);
  133. }
  134. _TMPLT(_Ty) inline
  135. _CMPLX(_Ty) __cdecl operator*(const _Ty& _Left,
  136. const _CMPLX(_Ty)& _Right)
  137. { // multiply real by complex
  138. _CMPLX(_Ty) _Tmp(_Left);
  139. return (_Tmp *= _Right);
  140. }
  141. // TEMPLATE FUNCTION operator/
  142. _TMPLT(_Ty) inline
  143. _CMPLX(_Ty) __cdecl operator/(const _CMPLX(_Ty)& _Left,
  144. const _CMPLX(_Ty)& _Right)
  145. { // divide complex by complex
  146. _CMPLX(_Ty) _Tmp(_Left);
  147. return (_Tmp /= _Right);
  148. }
  149. _TMPLT(_Ty) inline
  150. _CMPLX(_Ty) __cdecl operator/(const _CMPLX(_Ty)& _Left,
  151. const _Ty& _Right)
  152. { // divide complex by real
  153. _CMPLX(_Ty) _Tmp(_Left);
  154. _Tmp.real(_Tmp.real() / _Right);
  155. _Tmp.imag(_Tmp.imag() / _Right);
  156. return (_Tmp);
  157. }
  158. _TMPLT(_Ty) inline
  159. _CMPLX(_Ty) __cdecl operator/(const _Ty& _Left,
  160. const _CMPLX(_Ty)& _Right)
  161. { // divide real by complex
  162. _CMPLX(_Ty) _Tmp(_Left);
  163. return (_Tmp /= _Right);
  164. }
  165. // TEMPLATE FUNCTION UNARY operator+
  166. _TMPLT(_Ty) inline
  167. _CMPLX(_Ty) __cdecl operator+(const _CMPLX(_Ty)& _Left)
  168. { // return +complex
  169. return (_CMPLX(_Ty)(_Left));
  170. }
  171. // TEMPLATE FUNCTION UNARY operator-
  172. _TMPLT(_Ty) inline
  173. _CMPLX(_Ty) __cdecl operator-(const _CMPLX(_Ty)& _Left)
  174. { // return -complex
  175. return (_CMPLX(_Ty)(-real(_Left), -imag(_Left)));
  176. }
  177. // TEMPLATE FUNCTION operator==
  178. _TMPLT(_Ty) inline
  179. bool __cdecl operator==(const _CMPLX(_Ty)& _Left,
  180. const _CMPLX(_Ty)& _Right)
  181. { // test complex equal to complex
  182. return (real(_Left) == real(_Right) && imag(_Left) == imag(_Right));
  183. }
  184. _TMPLT(_Ty) inline
  185. bool __cdecl operator==(const _CMPLX(_Ty)& _Left,
  186. const _Ty& _Right)
  187. { // test real equal to complex
  188. return (real(_Left) == _Right && imag(_Left) == 0);
  189. }
  190. _TMPLT(_Ty) inline
  191. bool __cdecl operator==(const _Ty& _Left,
  192. const _CMPLX(_Ty)& _Right)
  193. { // test complex equal to real
  194. return (_Left == real(_Right) && 0 == imag(_Right));
  195. }
  196. // TEMPLATE FUNCTION operator!=
  197. _TMPLT(_Ty) inline
  198. bool __cdecl operator!=(const _CMPLX(_Ty)& _Left,
  199. const _CMPLX(_Ty)& _Right)
  200. { // test complex not equal to complex
  201. return (!(_Left == _Right));
  202. }
  203. _TMPLT(_Ty) inline
  204. bool __cdecl operator!=(const _CMPLX(_Ty)& _Left,
  205. const _Ty& _Right)
  206. { // test real not equal to complex
  207. return (!(_Left == _Right));
  208. }
  209. _TMPLT(_Ty) inline
  210. bool __cdecl operator!=(const _Ty& _Left,
  211. const _CMPLX(_Ty)& _Right)
  212. { // test complex not equal to real
  213. return (!(_Left == _Right));
  214. }
  215. // TEMPLATE FUNCTION abs
  216. _TMPLT(_Ty) inline
  217. _Ty __cdecl abs(const _CMPLX(_Ty)& _Left)
  218. { // return |complex| as real
  219. int _Leftexp;
  220. _Ty _Rho = _Fabs(_Left, &_Leftexp); // get magnitude and scale factor
  221. if (_Leftexp == 0)
  222. return (_Rho); // no scale factor
  223. else
  224. return (_CTR(_Ty)::ldexp(_Rho, _Leftexp)); // scale result
  225. }
  226. // TEMPLATE FUNCTION arg
  227. _TMPLT(_Ty) inline
  228. _Ty __cdecl arg(const _CMPLX(_Ty)& _Left)
  229. { // return phase angle of complex as real
  230. return (_CTR(_Ty)::atan2(imag(_Left), real(_Left)));
  231. }
  232. // TEMPLATE FUNCTION conj
  233. _TMPLT(_Ty) inline
  234. _CMPLX(_Ty) __cdecl conj(const _CMPLX(_Ty)& _Left)
  235. { // return complex conjugate
  236. return (_CMPLX(_Ty)(real(_Left), -imag(_Left)));
  237. }
  238. // TEMPLATE FUNCTION cos
  239. _TMPLT(_Ty) inline
  240. _CMPLX(_Ty) __cdecl cos(const _CMPLX(_Ty)& _Left)
  241. { // return cos(complex)
  242. return (_CMPLX(_Ty)(
  243. _CTR(_Ty)::_Cosh(imag(_Left), _CTR(_Ty)::cos(real(_Left))),
  244. -_CTR(_Ty)::_Sinh(imag(_Left),
  245. _CTR(_Ty)::sin(real(_Left)))));
  246. }
  247. // TEMPLATE FUNCTION cosh
  248. _TMPLT(_Ty) inline
  249. _CMPLX(_Ty) __cdecl cosh(const _CMPLX(_Ty)& _Left)
  250. { // return cosh(complex)
  251. return (_CMPLX(_Ty)(
  252. _CTR(_Ty)::_Cosh(real(_Left), _CTR(_Ty)::cos(imag(_Left))),
  253. _CTR(_Ty)::_Sinh(real(_Left), _CTR(_Ty)::sin(imag(_Left)))));
  254. }
  255. // TEMPLATE FUNCTION exp
  256. _TMPLT(_Ty) inline
  257. _CMPLX(_Ty) __cdecl exp(const _CMPLX(_Ty)& _Left)
  258. { // return exp(complex)
  259. _Ty _Real(real(_Left)), _Imag(real(_Left));
  260. _CTR(_Ty)::_Exp(&_Real, _CTR(_Ty)::cos(imag(_Left)), 0);
  261. _CTR(_Ty)::_Exp(&_Imag, _CTR(_Ty)::sin(imag(_Left)), 0);
  262. return (_CMPLX(_Ty)(_Real, _Imag));
  263. }
  264. // TEMPLATE FUNCTION log
  265. _TMPLT(_Ty) inline
  266. _CMPLX(_Ty) __cdecl log(const _CMPLX(_Ty)& _Left)
  267. { // return log(complex)
  268. _Ty _Theta = _CTR(_Ty)::atan2(imag(_Left), real(_Left)); // get phase
  269. if (_CTR(_Ty)::_Isnan(_Theta))
  270. return (_CMPLX(_Ty)(_Theta, _Theta)); // real or imag is NaN
  271. else
  272. { // use 1 1/2 precision to preserve bits
  273. static const _Ty _Cm = (_Ty)(22713.0L / 32768.0L);
  274. static const _Ty _Cl = (_Ty)1.4286068203094172321214581765680755e-6L;
  275. int _Leftexp;
  276. _Ty _Rho = _Fabs(_Left, &_Leftexp); // get magnitude and scale factor
  277. _Ty _Leftn = (_Ty)_Leftexp;
  278. _CMPLX(_Ty) _Tmp(
  279. _Rho == 0 ? -_CTR(_Ty)::_Infv(_Rho) // log(0) == -INF
  280. : _CTR(_Ty)::_Isinf(_Rho) ? _Rho // log(INF) == INF
  281. : _CTR(_Ty)::log(_Rho) + _Leftn * _Cl + _Leftn * _Cm,
  282. _Theta);
  283. return (_Tmp);
  284. }
  285. }
  286. // TEMPLATE FUNCTION log10
  287. _TMPLT(_Ty) inline
  288. _CMPLX(_Ty) __cdecl log10(const _CMPLX(_Ty)& _Left)
  289. { // return log10(complex)
  290. return (log(_Left) * (_Ty)0.43429448190325182765112891891660508L);
  291. }
  292. // TEMPLATE FUNCTION norm
  293. _TMPLT(_Ty) inline
  294. _Ty __cdecl norm(const _CMPLX(_Ty)& _Left)
  295. { // return squared magnitude
  296. return (real(_Left) * real(_Left) + imag(_Left) * imag(_Left));
  297. }
  298. // TEMPLATE FUNCTION polar
  299. _TMPLT(_Ty) inline
  300. _CMPLX(_Ty) __cdecl polar(const _Ty& _Rho, const _Ty& _Theta)
  301. { // return _Rho * exp(i * _Theta) as complex
  302. return (_CMPLX(_Ty)(_Rho * _CTR(_Ty)::cos(_Theta),
  303. _Rho * _CTR(_Ty)::sin(_Theta)));
  304. }
  305. _TMPLT(_Ty) inline
  306. _CMPLX(_Ty) __cdecl polar(const _Ty& _Rho)
  307. { // return _Rho * exp(i * 0) as complex
  308. return (_CMPLX(_Ty)(_Rho, (_Ty)0));
  309. }
  310. // TEMPLATE FUNCTION pow
  311. _TMPLT(_Ty) inline
  312. _CMPLX(_Ty) __cdecl pow(const _CMPLX(_Ty)& _Left, const _Ty& _Right)
  313. { // return complex ^ real
  314. if (imag(_Left) == 0 && 0 <= real(_Left))
  315. return (_CMPLX(_Ty)(_CTR(_Ty)::pow(real(_Left), _Right)));
  316. else
  317. return (exp(_Right * log(_Left)));
  318. }
  319. _TMPLT(_Ty) inline
  320. _CMPLX(_Ty) __cdecl pow(const _CMPLX(_Ty)& _Left, int _Right)
  321. { // return complex ^ integer
  322. _CMPLX(_Ty) _Tmp = _Left;
  323. unsigned int _Count = _Right;
  324. if (_Right < 0)
  325. _Count = 0 - _Count; // safe negation as unsigned
  326. for (_CMPLX(_Ty) _Zv = _CMPLX(_Ty)(1); ; _Tmp *= _Tmp)
  327. { // fold in _Left ^ (2 ^ _Count) as needed
  328. if ((_Count & 1) != 0)
  329. _Zv *= _Tmp;
  330. if ((_Count >>= 1) == 0)
  331. return (_Right < 0 ? _CMPLX(_Ty)(1) / _Zv : _Zv);
  332. }
  333. }
  334. _TMPLT(_Ty) inline
  335. _CMPLX(_Ty) __cdecl pow(const _Ty& _Left, const _CMPLX(_Ty)& _Right)
  336. { // return real ^ complex
  337. if (imag(_Right) == 0)
  338. return (_CMPLX(_Ty)(_CTR(_Ty)::pow(_Left, real(_Right))));
  339. else
  340. return (exp(_Right * _CTR(_Ty)::log(_Left)));
  341. }
  342. _TMPLT(_Ty) inline
  343. _CMPLX(_Ty) __cdecl pow(const _CMPLX(_Ty)& _Left,
  344. const _CMPLX(_Ty)& _Right)
  345. { // return complex ^ complex
  346. if (imag(_Right) == 0)
  347. return (pow(_Left, real(_Right)));
  348. else if (imag(_Left) == 0)
  349. return (_CMPLX(_Ty)(pow(real(_Left), _Right)));
  350. else
  351. return (exp(_Right * log(_Left)));
  352. }
  353. // TEMPLATE FUNCTION sin
  354. _TMPLT(_Ty) inline
  355. _CMPLX(_Ty) __cdecl sin(const _CMPLX(_Ty)& _Left)
  356. { // return sin(complex)
  357. return (_CMPLX(_Ty)(
  358. _CTR(_Ty)::_Cosh(imag(_Left), _CTR(_Ty)::sin(real(_Left))),
  359. _CTR(_Ty)::_Sinh(imag(_Left), _CTR(_Ty)::cos(real(_Left)))));
  360. }
  361. // TEMPLATE FUNCTION sinh
  362. _TMPLT(_Ty) inline
  363. _CMPLX(_Ty) __cdecl sinh(const _CMPLX(_Ty)& _Left)
  364. { // return sinh(complex)
  365. return (_CMPLX(_Ty)(
  366. _CTR(_Ty)::_Sinh(real(_Left), _CTR(_Ty)::cos(imag(_Left))),
  367. _CTR(_Ty)::_Cosh(real(_Left), _CTR(_Ty)::sin(imag(_Left)))));
  368. }
  369. // TEMPLATE FUNCTION sqrt
  370. _TMPLT(_Ty) inline
  371. _CMPLX(_Ty) __cdecl sqrt(const _CMPLX(_Ty)& _Left)
  372. { // return sqrt(complex)
  373. int _Leftexp;
  374. _Ty _Rho = _Fabs(_Left, &_Leftexp); // get magnitude and scale factor
  375. if (_Leftexp == 0)
  376. return (_CMPLX(_Ty)(_Rho, _Rho)); // argument is zero, INF, or NaN
  377. else
  378. { // compute in safest quadrant
  379. _Ty _Realmag = _CTR(_Ty)::ldexp(real(_Left) < 0
  380. ? - real(_Left) : real(_Left), -_Leftexp);
  381. _Rho = _CTR(_Ty)::ldexp(_CTR(_Ty)::sqrt(
  382. 2 * (_Realmag + _Rho)), _Leftexp / 2 - 1);
  383. if (0 <= real(_Left))
  384. return (_CMPLX(_Ty)(_Rho, imag(_Left) / (2 * _Rho)));
  385. else if (imag(_Left) < 0)
  386. return (_CMPLX(_Ty)(-imag(_Left) / (2 * _Rho), -_Rho));
  387. else
  388. return (_CMPLX(_Ty)(imag(_Left) / (2 * _Rho), _Rho));
  389. }
  390. }
  391. // TEMPLATE FUNCTION tanh
  392. _TMPLT(_Ty) inline
  393. _CMPLX(_Ty) __cdecl tanh(const _CMPLX(_Ty)& _Left)
  394. { // return tanh(complex)
  395. _Ty _Tv = _CTR(_Ty)::tan(imag(_Left));
  396. _Ty _Sv = _CTR(_Ty)::_Sinh(real(_Left), (_Ty)(1));
  397. _Ty _Bv = _Sv *((_Ty)(1) + _Tv * _Tv);
  398. _Ty _Dv = (_Ty)(1) + _Bv * _Sv;
  399. return (_CMPLX(_Ty)((_CTR(_Ty)::sqrt((_Ty)(1) + _Sv * _Sv))
  400. * _Bv / _Dv, _Tv / _Dv));
  401. }
  402. // TEMPLATE FUNCTION tan
  403. _TMPLT(_Ty) inline
  404. _CMPLX(_Ty) __cdecl tan(const _CMPLX(_Ty)& _Left)
  405. { // return tan(complex)
  406. _CMPLX(_Ty) _Zv(tanh(_CMPLX(_Ty)(-imag(_Left), real(_Left))));
  407. return (_CMPLX(_Ty)(imag(_Zv), -real(_Zv)));
  408. }
  409. #ifdef _DLL_CPPLIB
  410. #ifndef CRTDLL2
  411. template _CRTIMP2 float
  412. __cdecl imag(const complex<float>&);
  413. template _CRTIMP2 float
  414. __cdecl real(const complex<float>&);
  415. template _CRTIMP2 float
  416. __cdecl _Fabs(const complex<float>&, int *);
  417. template _CRTIMP2 complex<float>
  418. __cdecl operator+(const complex<float>&, const complex<float>&);
  419. template _CRTIMP2 complex<float>
  420. __cdecl operator+(const complex<float>&, const float&);
  421. template _CRTIMP2 complex<float>
  422. __cdecl operator+(const float&, const complex<float>&);
  423. template _CRTIMP2 complex<float>
  424. __cdecl operator-(const complex<float>&, const complex<float>&);
  425. template _CRTIMP2 complex<float>
  426. __cdecl operator-(const complex<float>&, const float&);
  427. template _CRTIMP2 complex<float>
  428. __cdecl operator-(const float&, const complex<float>&);
  429. template _CRTIMP2 complex<float>
  430. __cdecl operator*(const complex<float>&, const complex<float>&);
  431. template _CRTIMP2 complex<float>
  432. __cdecl operator*(const complex<float>&, const float&);
  433. template _CRTIMP2 complex<float>
  434. __cdecl operator*(const float&, const complex<float>&);
  435. template _CRTIMP2 complex<float>
  436. __cdecl operator/(const complex<float>&, const complex<float>&);
  437. template _CRTIMP2 complex<float>
  438. __cdecl operator/(const complex<float>&, const float&);
  439. template _CRTIMP2 complex<float>
  440. __cdecl operator/(const float&, const complex<float>&);
  441. template _CRTIMP2 complex<float>
  442. __cdecl operator+(const complex<float>&);
  443. template _CRTIMP2 complex<float>
  444. __cdecl operator-(const complex<float>&);
  445. template _CRTIMP2 bool
  446. __cdecl operator==(const complex<float>&, const complex<float>&);
  447. template _CRTIMP2 bool
  448. __cdecl operator==(const complex<float>&, const float&);
  449. template _CRTIMP2 bool
  450. __cdecl operator==(const float&, const complex<float>&);
  451. template _CRTIMP2 bool
  452. __cdecl operator!=(const complex<float>&, const complex<float>&);
  453. template _CRTIMP2 bool
  454. __cdecl operator!=(const complex<float>&, const float&);
  455. template _CRTIMP2 bool
  456. __cdecl operator!=(const float&, const complex<float>&);
  457. template _CRTIMP2 float
  458. __cdecl abs(const complex<float>&);
  459. template _CRTIMP2 float
  460. __cdecl arg(const complex<float>&);
  461. template _CRTIMP2 complex<float>
  462. __cdecl conj(const complex<float>&);
  463. template _CRTIMP2 complex<float>
  464. __cdecl cos(const complex<float>&);
  465. template _CRTIMP2 complex<float>
  466. __cdecl cosh(const complex<float>&);
  467. template _CRTIMP2 complex<float>
  468. __cdecl exp(const complex<float>&);
  469. template _CRTIMP2 complex<float>
  470. __cdecl log(const complex<float>&);
  471. template _CRTIMP2 complex<float>
  472. __cdecl log10(const complex<float>&);
  473. template _CRTIMP2 float
  474. __cdecl norm(const complex<float>&);
  475. template _CRTIMP2 complex<float>
  476. __cdecl polar(const float&, const float&);
  477. template _CRTIMP2 complex<float>
  478. __cdecl polar(const float&);
  479. template _CRTIMP2 complex<float>
  480. __cdecl pow(const complex<float>&, const float&);
  481. template _CRTIMP2 complex<float>
  482. __cdecl pow(const complex<float>&, int);
  483. template _CRTIMP2 complex<float>
  484. __cdecl pow(const float&, const complex<float>&);
  485. template _CRTIMP2 complex<float>
  486. __cdecl pow(const complex<float>&, const complex<float>&);
  487. template _CRTIMP2 complex<float>
  488. __cdecl sin(const complex<float>&);
  489. template _CRTIMP2 complex<float>
  490. __cdecl sinh(const complex<float>&);
  491. template _CRTIMP2 complex<float>
  492. __cdecl sqrt(const complex<float>&);
  493. template _CRTIMP2 complex<float>
  494. __cdecl tanh(const complex<float>&);
  495. template _CRTIMP2 complex<float>
  496. __cdecl tan(const complex<float>&);
  497. template _CRTIMP2 double
  498. __cdecl imag(const complex<double>&);
  499. template _CRTIMP2 double
  500. __cdecl real(const complex<double>&);
  501. template _CRTIMP2 double
  502. __cdecl _Fabs(const complex<double>&, int *);
  503. template _CRTIMP2 complex<double>
  504. __cdecl operator+(const complex<double>&, const complex<double>&);
  505. template _CRTIMP2 complex<double>
  506. __cdecl operator+(const complex<double>&, const double&);
  507. template _CRTIMP2 complex<double>
  508. __cdecl operator+(const double&, const complex<double>&);
  509. template _CRTIMP2 complex<double>
  510. __cdecl operator-(const complex<double>&, const complex<double>&);
  511. template _CRTIMP2 complex<double>
  512. __cdecl operator-(const complex<double>&, const double&);
  513. template _CRTIMP2 complex<double>
  514. __cdecl operator-(const double&, const complex<double>&);
  515. template _CRTIMP2 complex<double>
  516. __cdecl operator*(const complex<double>&, const complex<double>&);
  517. template _CRTIMP2 complex<double>
  518. __cdecl operator*(const complex<double>&, const double&);
  519. template _CRTIMP2 complex<double>
  520. __cdecl operator*(const double&, const complex<double>&);
  521. template _CRTIMP2 complex<double>
  522. __cdecl operator/(const complex<double>&, const complex<double>&);
  523. template _CRTIMP2 complex<double>
  524. __cdecl operator/(const complex<double>&, const double&);
  525. template _CRTIMP2 complex<double>
  526. __cdecl operator/(const double&, const complex<double>&);
  527. template _CRTIMP2 complex<double>
  528. __cdecl operator+(const complex<double>&);
  529. template _CRTIMP2 complex<double>
  530. __cdecl operator-(const complex<double>&);
  531. template _CRTIMP2 bool
  532. __cdecl operator==(const complex<double>&, const complex<double>&);
  533. template _CRTIMP2 bool
  534. __cdecl operator==(const complex<double>&, const double&);
  535. template _CRTIMP2 bool
  536. __cdecl operator==(const double&, const complex<double>&);
  537. template _CRTIMP2 bool
  538. __cdecl operator!=(const complex<double>&, const complex<double>&);
  539. template _CRTIMP2 bool
  540. __cdecl operator!=(const complex<double>&, const double&);
  541. template _CRTIMP2 bool
  542. __cdecl operator!=(const double&, const complex<double>&);
  543. template _CRTIMP2 double
  544. __cdecl abs(const complex<double>&);
  545. template _CRTIMP2 double
  546. __cdecl arg(const complex<double>&);
  547. template _CRTIMP2 complex<double>
  548. __cdecl conj(const complex<double>&);
  549. template _CRTIMP2 complex<double>
  550. __cdecl cos(const complex<double>&);
  551. template _CRTIMP2 complex<double>
  552. __cdecl cosh(const complex<double>&);
  553. template _CRTIMP2 complex<double>
  554. __cdecl exp(const complex<double>&);
  555. template _CRTIMP2 complex<double>
  556. __cdecl log(const complex<double>&);
  557. template _CRTIMP2 complex<double>
  558. __cdecl log10(const complex<double>&);
  559. template _CRTIMP2 double
  560. __cdecl norm(const complex<double>&);
  561. template _CRTIMP2 complex<double>
  562. __cdecl polar(const double&, const double&);
  563. template _CRTIMP2 complex<double>
  564. __cdecl polar(const double&);
  565. template _CRTIMP2 complex<double>
  566. __cdecl pow(const complex<double>&, const double&);
  567. template _CRTIMP2 complex<double>
  568. __cdecl pow(const complex<double>&, int);
  569. template _CRTIMP2 complex<double>
  570. __cdecl pow(const double&, const complex<double>&);
  571. template _CRTIMP2 complex<double>
  572. __cdecl pow(const complex<double>&, const complex<double>&);
  573. template _CRTIMP2 complex<double>
  574. __cdecl sin(const complex<double>&);
  575. template _CRTIMP2 complex<double>
  576. __cdecl sinh(const complex<double>&);
  577. template _CRTIMP2 complex<double>
  578. __cdecl sqrt(const complex<double>&);
  579. template _CRTIMP2 complex<double>
  580. __cdecl tanh(const complex<double>&);
  581. template _CRTIMP2 complex<double>
  582. __cdecl tan(const complex<double>&);
  583. template _CRTIMP2 long double
  584. __cdecl imag(const complex<long double>&);
  585. template _CRTIMP2 long double
  586. __cdecl real(const complex<long double>&);
  587. template _CRTIMP2 long double
  588. __cdecl _Fabs(const complex<long double>&, int *);
  589. template _CRTIMP2 complex<long double>
  590. __cdecl operator+(const complex<long double>&,
  591. const complex<long double>&);
  592. template _CRTIMP2 complex<long double>
  593. __cdecl operator+(const complex<long double>&, const long double&);
  594. template _CRTIMP2 complex<long double>
  595. __cdecl operator+(const long double&, const complex<long double>&);
  596. template _CRTIMP2 complex<long double>
  597. __cdecl operator-(const complex<long double>&,
  598. const complex<long double>&);
  599. template _CRTIMP2 complex<long double>
  600. __cdecl operator-(const complex<long double>&, const long double&);
  601. template _CRTIMP2 complex<long double>
  602. __cdecl operator-(const long double&, const complex<long double>&);
  603. template _CRTIMP2 complex<long double>
  604. __cdecl operator*(const complex<long double>&,
  605. const complex<long double>&);
  606. template _CRTIMP2 complex<long double>
  607. __cdecl operator*(const complex<long double>&, const long double&);
  608. template _CRTIMP2 complex<long double>
  609. __cdecl operator*(const long double&, const complex<long double>&);
  610. template _CRTIMP2 complex<long double>
  611. __cdecl operator/(const complex<long double>&,
  612. const complex<long double>&);
  613. template _CRTIMP2 complex<long double>
  614. __cdecl operator/(const complex<long double>&, const long double&);
  615. template _CRTIMP2 complex<long double>
  616. __cdecl operator/(const long double&, const complex<long double>&);
  617. template _CRTIMP2 complex<long double>
  618. __cdecl operator+(const complex<long double>&);
  619. template _CRTIMP2 complex<long double>
  620. __cdecl operator-(const complex<long double>&);
  621. template _CRTIMP2 bool
  622. __cdecl operator==(const complex<long double>&,
  623. const complex<long double>&);
  624. template _CRTIMP2 bool
  625. __cdecl operator==(const complex<long double>&, const long double&);
  626. template _CRTIMP2 bool
  627. __cdecl operator==(const long double&, const complex<long double>&);
  628. template _CRTIMP2 bool
  629. __cdecl operator!=(const complex<long double>&,
  630. const complex<long double>&);
  631. template _CRTIMP2 bool
  632. __cdecl operator!=(const complex<long double>&, const long double&);
  633. template _CRTIMP2 bool
  634. __cdecl operator!=(const long double&, const complex<long double>&);
  635. template _CRTIMP2 long double
  636. __cdecl abs(const complex<long double>&);
  637. template _CRTIMP2 long double
  638. __cdecl arg(const complex<long double>&);
  639. template _CRTIMP2 complex<long double>
  640. __cdecl conj(const complex<long double>&);
  641. template _CRTIMP2 complex<long double>
  642. __cdecl cos(const complex<long double>&);
  643. template _CRTIMP2 complex<long double>
  644. __cdecl cosh(const complex<long double>&);
  645. template _CRTIMP2 complex<long double>
  646. __cdecl exp(const complex<long double>&);
  647. template _CRTIMP2 complex<long double>
  648. __cdecl log(const complex<long double>&);
  649. template _CRTIMP2 complex<long double>
  650. __cdecl log10(const complex<long double>&);
  651. template _CRTIMP2 long double
  652. __cdecl norm(const complex<long double>&);
  653. template _CRTIMP2 complex<long double>
  654. __cdecl polar(const long double&, const long double&);
  655. template _CRTIMP2 complex<long double>
  656. __cdecl polar(const long double&);
  657. template _CRTIMP2 complex<long double>
  658. __cdecl pow(const complex<long double>&, const long double&);
  659. template _CRTIMP2 complex<long double>
  660. __cdecl pow(const complex<long double>&, int);
  661. template _CRTIMP2 complex<long double>
  662. __cdecl pow(const long double&, const complex<long double>&);
  663. template _CRTIMP2 complex<long double>
  664. __cdecl pow(const complex<long double>&, const complex<long double>&);
  665. template _CRTIMP2 complex<long double>
  666. __cdecl sin(const complex<long double>&);
  667. template _CRTIMP2 complex<long double>
  668. __cdecl sinh(const complex<long double>&);
  669. template _CRTIMP2 complex<long double>
  670. __cdecl sqrt(const complex<long double>&);
  671. template _CRTIMP2 complex<long double>
  672. __cdecl tanh(const complex<long double>&);
  673. template _CRTIMP2 complex<long double>
  674. __cdecl tan(const complex<long double>&);
  675. #endif // CRTDLL2
  676. #endif // _DLL_CPPLIB
  677. #undef _XCOMPLEX_ /* SIC: may be included multiple times */
  678. #endif /* _XCOMPLEX_ */
  679. /*
  680. * Copyright (c) 1992-2001 by P.J. Plauger. ALL RIGHTS RESERVED.
  681. * Consult your license regarding permissions and restrictions.
  682. V3.10:0009 */