complex.h 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. /* $OpenBSD: complex.h,v 1.3 2010/07/24 22:17:03 guenther Exp $ */
  2. /*
  3. * Copyright (c) 2008 Martynas Venckus <martynas@openbsd.org>
  4. *
  5. * Permission to use, copy, modify, and distribute this software for any
  6. * purpose with or without fee is hereby granted, provided that the above
  7. * copyright notice and this permission notice appear in all copies.
  8. *
  9. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
  10. * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
  11. * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
  12. * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  13. * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
  14. * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  15. * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  16. */
  17. #ifndef _COMPLEX_H_
  18. #define _COMPLEX_H_
  19. #include <sys/cdefs.h>
  20. /*
  21. * C99
  22. */
  23. #ifdef __GNUC__
  24. #if __STDC_VERSION__ < 199901
  25. #define _Complex __complex__
  26. #endif
  27. #define _Complex_I 1.0fi
  28. #elif defined(lint)
  29. #define _Complex_I 1.0fi
  30. #endif
  31. #define complex _Complex
  32. /* XXX switch to _Imaginary_I */
  33. #undef I
  34. #define I _Complex_I
  35. __BEGIN_DECLS
  36. /*
  37. * Double versions of C99 functions
  38. */
  39. double complex cacos(double complex);
  40. double complex casin(double complex);
  41. double complex catan(double complex);
  42. double complex ccos(double complex);
  43. double complex csin(double complex);
  44. double complex ctan(double complex);
  45. double complex cacosh(double complex);
  46. double complex casinh(double complex);
  47. double complex catanh(double complex);
  48. double complex ccosh(double complex);
  49. double complex csinh(double complex);
  50. double complex ctanh(double complex);
  51. double complex cexp(double complex);
  52. double complex clog(double complex);
  53. double cabs(double complex);
  54. double complex cpow(double complex, double complex);
  55. double complex csqrt(double complex);
  56. double carg(double complex);
  57. double cimag(double complex);
  58. double complex conj(double complex);
  59. double complex cproj(double complex);
  60. double creal(double complex);
  61. /*
  62. * C99 reserved
  63. */
  64. double complex clog10(double complex);
  65. /*
  66. * Float versions of C99 functions
  67. */
  68. float complex cacosf(float complex);
  69. float complex casinf(float complex);
  70. float complex catanf(float complex);
  71. float complex ccosf(float complex);
  72. float complex csinf(float complex);
  73. float complex ctanf(float complex);
  74. float complex cacoshf(float complex);
  75. float complex casinhf(float complex);
  76. float complex catanhf(float complex);
  77. float complex ccoshf(float complex);
  78. float complex csinhf(float complex);
  79. float complex ctanhf(float complex);
  80. float complex cexpf(float complex);
  81. float complex clogf(float complex);
  82. float cabsf(float complex);
  83. float complex cpowf(float complex, float complex);
  84. float complex csqrtf(float complex);
  85. float cargf(float complex);
  86. float cimagf(float complex);
  87. float complex conjf(float complex);
  88. float complex cprojf(float complex);
  89. float crealf(float complex);
  90. /*
  91. * C99 reserved
  92. */
  93. float complex clog10f(float complex);
  94. /*
  95. * Long double versions of C99 functions
  96. */
  97. long double complex cacosl(long double complex);
  98. long double complex casinl(long double complex);
  99. long double complex catanl(long double complex);
  100. long double complex ccosl(long double complex);
  101. long double complex csinl(long double complex);
  102. long double complex ctanl(long double complex);
  103. long double complex cacoshl(long double complex);
  104. long double complex casinhl(long double complex);
  105. long double complex catanhl(long double complex);
  106. long double complex ccoshl(long double complex);
  107. long double complex csinhl(long double complex);
  108. long double complex ctanhl(long double complex);
  109. long double complex cexpl(long double complex);
  110. long double complex clogl(long double complex);
  111. long double cabsl(long double complex);
  112. long double complex cpowl(long double complex, long double complex);
  113. long double complex csqrtl(long double complex);
  114. long double cargl(long double complex);
  115. long double cimagl(long double complex);
  116. long double complex conjl(long double complex);
  117. long double complex cprojl(long double complex);
  118. long double creall(long double complex);
  119. /*
  120. * C99 reserved
  121. */
  122. long double complex clog10l(long double complex);
  123. __END_DECLS
  124. #endif /* !_COMPLEX_H_ */