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.

739 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. template _CRTIMP2 float
  411. __cdecl imag(const complex<float>&);
  412. template _CRTIMP2 float
  413. __cdecl real(const complex<float>&);
  414. template _CRTIMP2 float
  415. __cdecl _Fabs(const complex<float>&, int *);
  416. template _CRTIMP2 complex<float>
  417. __cdecl operator+(const complex<float>&, const complex<float>&);
  418. template _CRTIMP2 complex<float>
  419. __cdecl operator+(const complex<float>&, const float&);
  420. template _CRTIMP2 complex<float>
  421. __cdecl operator+(const float&, const complex<float>&);
  422. template _CRTIMP2 complex<float>
  423. __cdecl operator-(const complex<float>&, const complex<float>&);
  424. template _CRTIMP2 complex<float>
  425. __cdecl operator-(const complex<float>&, const float&);
  426. template _CRTIMP2 complex<float>
  427. __cdecl operator-(const float&, const complex<float>&);
  428. template _CRTIMP2 complex<float>
  429. __cdecl operator*(const complex<float>&, const complex<float>&);
  430. template _CRTIMP2 complex<float>
  431. __cdecl operator*(const complex<float>&, const float&);
  432. template _CRTIMP2 complex<float>
  433. __cdecl operator*(const float&, const complex<float>&);
  434. template _CRTIMP2 complex<float>
  435. __cdecl operator/(const complex<float>&, const complex<float>&);
  436. template _CRTIMP2 complex<float>
  437. __cdecl operator/(const complex<float>&, const float&);
  438. template _CRTIMP2 complex<float>
  439. __cdecl operator/(const float&, const complex<float>&);
  440. template _CRTIMP2 complex<float>
  441. __cdecl operator+(const complex<float>&);
  442. template _CRTIMP2 complex<float>
  443. __cdecl operator-(const complex<float>&);
  444. template _CRTIMP2 bool
  445. __cdecl operator==(const complex<float>&, const complex<float>&);
  446. template _CRTIMP2 bool
  447. __cdecl operator==(const complex<float>&, const float&);
  448. template _CRTIMP2 bool
  449. __cdecl operator==(const float&, const complex<float>&);
  450. template _CRTIMP2 bool
  451. __cdecl operator!=(const complex<float>&, const complex<float>&);
  452. template _CRTIMP2 bool
  453. __cdecl operator!=(const complex<float>&, const float&);
  454. template _CRTIMP2 bool
  455. __cdecl operator!=(const float&, const complex<float>&);
  456. template _CRTIMP2 float
  457. __cdecl abs(const complex<float>&);
  458. template _CRTIMP2 float
  459. __cdecl arg(const complex<float>&);
  460. template _CRTIMP2 complex<float>
  461. __cdecl conj(const complex<float>&);
  462. template _CRTIMP2 complex<float>
  463. __cdecl cos(const complex<float>&);
  464. template _CRTIMP2 complex<float>
  465. __cdecl cosh(const complex<float>&);
  466. template _CRTIMP2 complex<float>
  467. __cdecl exp(const complex<float>&);
  468. template _CRTIMP2 complex<float>
  469. __cdecl log(const complex<float>&);
  470. template _CRTIMP2 complex<float>
  471. __cdecl log10(const complex<float>&);
  472. template _CRTIMP2 float
  473. __cdecl norm(const complex<float>&);
  474. template _CRTIMP2 complex<float>
  475. __cdecl polar(const float&, const float&);
  476. template _CRTIMP2 complex<float>
  477. __cdecl polar(const float&);
  478. template _CRTIMP2 complex<float>
  479. __cdecl pow(const complex<float>&, const float&);
  480. template _CRTIMP2 complex<float>
  481. __cdecl pow(const complex<float>&, int);
  482. template _CRTIMP2 complex<float>
  483. __cdecl pow(const float&, const complex<float>&);
  484. template _CRTIMP2 complex<float>
  485. __cdecl pow(const complex<float>&, const complex<float>&);
  486. template _CRTIMP2 complex<float>
  487. __cdecl sin(const complex<float>&);
  488. template _CRTIMP2 complex<float>
  489. __cdecl sinh(const complex<float>&);
  490. template _CRTIMP2 complex<float>
  491. __cdecl sqrt(const complex<float>&);
  492. template _CRTIMP2 complex<float>
  493. __cdecl tanh(const complex<float>&);
  494. template _CRTIMP2 complex<float>
  495. __cdecl tan(const complex<float>&);
  496. template _CRTIMP2 double
  497. __cdecl imag(const complex<double>&);
  498. template _CRTIMP2 double
  499. __cdecl real(const complex<double>&);
  500. template _CRTIMP2 double
  501. __cdecl _Fabs(const complex<double>&, int *);
  502. template _CRTIMP2 complex<double>
  503. __cdecl operator+(const complex<double>&, const complex<double>&);
  504. template _CRTIMP2 complex<double>
  505. __cdecl operator+(const complex<double>&, const double&);
  506. template _CRTIMP2 complex<double>
  507. __cdecl operator+(const double&, const complex<double>&);
  508. template _CRTIMP2 complex<double>
  509. __cdecl operator-(const complex<double>&, const complex<double>&);
  510. template _CRTIMP2 complex<double>
  511. __cdecl operator-(const complex<double>&, const double&);
  512. template _CRTIMP2 complex<double>
  513. __cdecl operator-(const double&, const complex<double>&);
  514. template _CRTIMP2 complex<double>
  515. __cdecl operator*(const complex<double>&, const complex<double>&);
  516. template _CRTIMP2 complex<double>
  517. __cdecl operator*(const complex<double>&, const double&);
  518. template _CRTIMP2 complex<double>
  519. __cdecl operator*(const double&, const complex<double>&);
  520. template _CRTIMP2 complex<double>
  521. __cdecl operator/(const complex<double>&, const complex<double>&);
  522. template _CRTIMP2 complex<double>
  523. __cdecl operator/(const complex<double>&, const double&);
  524. template _CRTIMP2 complex<double>
  525. __cdecl operator/(const double&, const complex<double>&);
  526. template _CRTIMP2 complex<double>
  527. __cdecl operator+(const complex<double>&);
  528. template _CRTIMP2 complex<double>
  529. __cdecl operator-(const complex<double>&);
  530. template _CRTIMP2 bool
  531. __cdecl operator==(const complex<double>&, const complex<double>&);
  532. template _CRTIMP2 bool
  533. __cdecl operator==(const complex<double>&, const double&);
  534. template _CRTIMP2 bool
  535. __cdecl operator==(const double&, const complex<double>&);
  536. template _CRTIMP2 bool
  537. __cdecl operator!=(const complex<double>&, const complex<double>&);
  538. template _CRTIMP2 bool
  539. __cdecl operator!=(const complex<double>&, const double&);
  540. template _CRTIMP2 bool
  541. __cdecl operator!=(const double&, const complex<double>&);
  542. template _CRTIMP2 double
  543. __cdecl abs(const complex<double>&);
  544. template _CRTIMP2 double
  545. __cdecl arg(const complex<double>&);
  546. template _CRTIMP2 complex<double>
  547. __cdecl conj(const complex<double>&);
  548. template _CRTIMP2 complex<double>
  549. __cdecl cos(const complex<double>&);
  550. template _CRTIMP2 complex<double>
  551. __cdecl cosh(const complex<double>&);
  552. template _CRTIMP2 complex<double>
  553. __cdecl exp(const complex<double>&);
  554. template _CRTIMP2 complex<double>
  555. __cdecl log(const complex<double>&);
  556. template _CRTIMP2 complex<double>
  557. __cdecl log10(const complex<double>&);
  558. template _CRTIMP2 double
  559. __cdecl norm(const complex<double>&);
  560. template _CRTIMP2 complex<double>
  561. __cdecl polar(const double&, const double&);
  562. template _CRTIMP2 complex<double>
  563. __cdecl polar(const double&);
  564. template _CRTIMP2 complex<double>
  565. __cdecl pow(const complex<double>&, const double&);
  566. template _CRTIMP2 complex<double>
  567. __cdecl pow(const complex<double>&, int);
  568. template _CRTIMP2 complex<double>
  569. __cdecl pow(const double&, const complex<double>&);
  570. template _CRTIMP2 complex<double>
  571. __cdecl pow(const complex<double>&, const complex<double>&);
  572. template _CRTIMP2 complex<double>
  573. __cdecl sin(const complex<double>&);
  574. template _CRTIMP2 complex<double>
  575. __cdecl sinh(const complex<double>&);
  576. template _CRTIMP2 complex<double>
  577. __cdecl sqrt(const complex<double>&);
  578. template _CRTIMP2 complex<double>
  579. __cdecl tanh(const complex<double>&);
  580. template _CRTIMP2 complex<double>
  581. __cdecl tan(const complex<double>&);
  582. template _CRTIMP2 long double
  583. __cdecl imag(const complex<long double>&);
  584. template _CRTIMP2 long double
  585. __cdecl real(const complex<long double>&);
  586. template _CRTIMP2 long double
  587. __cdecl _Fabs(const complex<long double>&, int *);
  588. template _CRTIMP2 complex<long double>
  589. __cdecl operator+(const complex<long double>&,
  590. const complex<long double>&);
  591. template _CRTIMP2 complex<long double>
  592. __cdecl operator+(const complex<long double>&, const long double&);
  593. template _CRTIMP2 complex<long double>
  594. __cdecl operator+(const long double&, const complex<long double>&);
  595. template _CRTIMP2 complex<long double>
  596. __cdecl operator-(const complex<long double>&,
  597. const complex<long double>&);
  598. template _CRTIMP2 complex<long double>
  599. __cdecl operator-(const complex<long double>&, const long double&);
  600. template _CRTIMP2 complex<long double>
  601. __cdecl operator-(const long double&, const complex<long double>&);
  602. template _CRTIMP2 complex<long double>
  603. __cdecl operator*(const complex<long double>&,
  604. const complex<long double>&);
  605. template _CRTIMP2 complex<long double>
  606. __cdecl operator*(const complex<long double>&, const long double&);
  607. template _CRTIMP2 complex<long double>
  608. __cdecl operator*(const long double&, const complex<long double>&);
  609. template _CRTIMP2 complex<long double>
  610. __cdecl operator/(const complex<long double>&,
  611. const complex<long double>&);
  612. template _CRTIMP2 complex<long double>
  613. __cdecl operator/(const complex<long double>&, const long double&);
  614. template _CRTIMP2 complex<long double>
  615. __cdecl operator/(const long double&, const complex<long double>&);
  616. template _CRTIMP2 complex<long double>
  617. __cdecl operator+(const complex<long double>&);
  618. template _CRTIMP2 complex<long double>
  619. __cdecl operator-(const complex<long double>&);
  620. template _CRTIMP2 bool
  621. __cdecl operator==(const complex<long double>&,
  622. const complex<long double>&);
  623. template _CRTIMP2 bool
  624. __cdecl operator==(const complex<long double>&, const long double&);
  625. template _CRTIMP2 bool
  626. __cdecl operator==(const long double&, const complex<long double>&);
  627. template _CRTIMP2 bool
  628. __cdecl operator!=(const complex<long double>&,
  629. const complex<long double>&);
  630. template _CRTIMP2 bool
  631. __cdecl operator!=(const complex<long double>&, const long double&);
  632. template _CRTIMP2 bool
  633. __cdecl operator!=(const long double&, const complex<long double>&);
  634. template _CRTIMP2 long double
  635. __cdecl abs(const complex<long double>&);
  636. template _CRTIMP2 long double
  637. __cdecl arg(const complex<long double>&);
  638. template _CRTIMP2 complex<long double>
  639. __cdecl conj(const complex<long double>&);
  640. template _CRTIMP2 complex<long double>
  641. __cdecl cos(const complex<long double>&);
  642. template _CRTIMP2 complex<long double>
  643. __cdecl cosh(const complex<long double>&);
  644. template _CRTIMP2 complex<long double>
  645. __cdecl exp(const complex<long double>&);
  646. template _CRTIMP2 complex<long double>
  647. __cdecl log(const complex<long double>&);
  648. template _CRTIMP2 complex<long double>
  649. __cdecl log10(const complex<long double>&);
  650. template _CRTIMP2 long double
  651. __cdecl norm(const complex<long double>&);
  652. template _CRTIMP2 complex<long double>
  653. __cdecl polar(const long double&, const long double&);
  654. template _CRTIMP2 complex<long double>
  655. __cdecl polar(const long double&);
  656. template _CRTIMP2 complex<long double>
  657. __cdecl pow(const complex<long double>&, const long double&);
  658. template _CRTIMP2 complex<long double>
  659. __cdecl pow(const complex<long double>&, int);
  660. template _CRTIMP2 complex<long double>
  661. __cdecl pow(const long double&, const complex<long double>&);
  662. template _CRTIMP2 complex<long double>
  663. __cdecl pow(const complex<long double>&, const complex<long double>&);
  664. template _CRTIMP2 complex<long double>
  665. __cdecl sin(const complex<long double>&);
  666. template _CRTIMP2 complex<long double>
  667. __cdecl sinh(const complex<long double>&);
  668. template _CRTIMP2 complex<long double>
  669. __cdecl sqrt(const complex<long double>&);
  670. template _CRTIMP2 complex<long double>
  671. __cdecl tanh(const complex<long double>&);
  672. template _CRTIMP2 complex<long double>
  673. __cdecl tan(const complex<long double>&);
  674. #endif // _DLL_CPPLIB
  675. #undef _XCOMPLEX_ /* SIC: may be included multiple times */
  676. #endif /* _XCOMPLEX_ */
  677. /*
  678. * Copyright (c) 1992-2001 by P.J. Plauger. ALL RIGHTS RESERVED.
  679. * Consult your license regarding permissions and restrictions.
  680. V3.10:0009 */