c99_ref.qbk 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299
  1. [section:c99 C99 C Functions]
  2. [h4 Supported C99 Functions]
  3. namespace boost{ namespace math{ namespace tr1{ extern "C"{
  4. typedef unspecified float_t;
  5. typedef unspecified double_t;
  6. double acosh(double x);
  7. float acoshf(float x);
  8. long double acoshl(long double x);
  9. double asinh(double x);
  10. float asinhf(float x);
  11. long double asinhl(long double x);
  12. double atanh(double x);
  13. float atanhf(float x);
  14. long double atanhl(long double x);
  15. double cbrt(double x);
  16. float cbrtf(float x);
  17. long double cbrtl(long double x);
  18. double copysign(double x, double y);
  19. float copysignf(float x, float y);
  20. long double copysignl(long double x, long double y);
  21. double erf(double x);
  22. float erff(float x);
  23. long double erfl(long double x);
  24. double erfc(double x);
  25. float erfcf(float x);
  26. long double erfcl(long double x);
  27. double expm1(double x);
  28. float expm1f(float x);
  29. long double expm1l(long double x);
  30. double fmax(double x, double y);
  31. float fmaxf(float x, float y);
  32. long double fmaxl(long double x, long double y);
  33. double fmin(double x, double y);
  34. float fminf(float x, float y);
  35. long double fminl(long double x, long double y);
  36. double hypot(double x, double y);
  37. float hypotf(float x, float y);
  38. long double hypotl(long double x, long double y);
  39. double lgamma(double x);
  40. float lgammaf(float x);
  41. long double lgammal(long double x);
  42. long long llround(double x);
  43. long long llroundf(float x);
  44. long long llroundl(long double x);
  45. double log1p(double x);
  46. float log1pf(float x);
  47. long double log1pl(long double x);
  48. long lround(double x);
  49. long lroundf(float x);
  50. long lroundl(long double x);
  51. double nextafter(double x, double y);
  52. float nextafterf(float x, float y);
  53. long double nextafterl(long double x, long double y);
  54. double nexttoward(double x, long double y);
  55. float nexttowardf(float x, long double y);
  56. long double nexttowardl(long double x, long double y);
  57. double round(double x);
  58. float roundf(float x);
  59. long double roundl(long double x);
  60. double tgamma(double x);
  61. float tgammaf(float x);
  62. long double tgammal(long double x);
  63. double trunc(double x);
  64. float truncf(float x);
  65. long double truncl(long double x);
  66. }}}} // namespaces
  67. In addition sufficient additional overloads of the `double` versions of the
  68. above functions are provided, so that calling the function with any mixture
  69. of `float`, `double`, `long double`, or /integer/ arguments is supported, with the
  70. return type determined by the __arg_promotion_rules.
  71. For example:
  72. acoshf(2.0f); // float version, returns float.
  73. acosh(2.0f); // also calls the float version and returns float.
  74. acosh(2.0); // double version, returns double.
  75. acoshl(2.0L); // long double version, returns a long double.
  76. acosh(2.0L); // also calls the long double version.
  77. acosh(2); // integer argument is treated as a double, returns double.
  78. [h4 Quick Reference]
  79. More detailed descriptions of these functions are available in the
  80. C99 standard.
  81. typedef unspecified float_t;
  82. typedef unspecified double_t;
  83. In this implementation `float_t` is the same as type `float`, and
  84. `double_t` the same as type `double` unless the preprocessor symbol
  85. FLT_EVAL_METHOD is defined, in which case these are set as follows:
  86. [table
  87. [[FLT_EVAL_METHOD][float_t][double_t]]
  88. [[0][float][double]]
  89. [[1][double][double]]
  90. [[2][long double][long double]]
  91. ]
  92. double acosh(double x);
  93. float acoshf(float x);
  94. long double acoshl(long double x);
  95. Returns the inverse hyperbolic cosine of /x/.
  96. See also __acosh for the full template (header only) version of this function.
  97. double asinh(double x);
  98. float asinhf(float x);
  99. long double asinhl(long double x);
  100. Returns the inverse hyperbolic sine of /x/.
  101. See also __asinh for the full template (header only) version of this function.
  102. double atanh(double x);
  103. float atanhf(float x);
  104. long double atanhl(long double x);
  105. Returns the inverse hyperbolic tangent of /x/.
  106. See also __atanh for the full template (header only) version of this function.
  107. double cbrt(double x);
  108. float cbrtf(float x);
  109. long double cbrtl(long double x);
  110. Returns the cubed root of /x/.
  111. See also __cbrt for the full template (header only) version of this function.
  112. double copysign(double x, double y);
  113. float copysignf(float x, float y);
  114. long double copysignl(long double x, long double y);
  115. Returns a value with the magnitude of /x/ and the sign of /y/.
  116. double erf(double x);
  117. float erff(float x);
  118. long double erfl(long double x);
  119. Returns the error function of /x/:
  120. [equation erf1]
  121. See also __erf for the full template (header only) version of this function.
  122. double erfc(double x);
  123. float erfcf(float x);
  124. long double erfcl(long double x);
  125. Returns the complementary error function of /x/ `1-erf(x)` without the loss
  126. of precision implied by the subtraction.
  127. See also __erfc for the full template (header only) version of this function.
  128. double expm1(double x);
  129. float expm1f(float x);
  130. long double expm1l(long double x);
  131. Returns `exp(x)-1` without the loss
  132. of precision implied by the subtraction.
  133. See also __expm1 for the full template (header only) version of this function.
  134. double fmax(double x, double y);
  135. float fmaxf(float x, float y);
  136. long double fmaxl(long double x, long double y);
  137. Returns the larger (most positive) of /x/ and /y/.
  138. double fmin(double x, double y);
  139. float fminf(float x, float y);
  140. long double fminl(long double x, long double y);
  141. Returns the smaller (most negative) of /x/ and /y/.
  142. double hypot(double x, double y);
  143. float hypotf(float x, float y);
  144. long double hypotl(long double x, long double y);
  145. Returns `sqrt(x*x + y*y)` without the danger of numeric overflow
  146. implied by that formulation.
  147. See also __hypot for the full template (header only) version of this function.
  148. double lgamma(double x);
  149. float lgammaf(float x);
  150. long double lgammal(long double x);
  151. Returns the log of the gamma function of /x/.
  152. [equation lgamm1]
  153. See also __lgamma for the full template (header only) version of this function.
  154. long long llround(double x);
  155. long long llroundf(float x);
  156. long long llroundl(long double x);
  157. Returns the value /x/ rounded to the nearest integer as a `long long`:
  158. equivalent to `floor(x + 0.5)`
  159. See also __llround for the full template (header only) version of this function.
  160. double log1p(double x);
  161. float log1pf(float x);
  162. long double log1pl(long double x);
  163. Returns the `log(x+1)` without the loss of precision
  164. implied by that formulation.
  165. See also __log1p for the full template (header only) version of this function.
  166. long lround(double x);
  167. long lroundf(float x);
  168. long lroundl(long double x);
  169. Returns the value /x/ rounded to the nearest integer as a `long`:
  170. equivalent to `floor(x + 0.5)`
  171. See also __lround for the full template (header only) version of this function.
  172. double nextafter(double x, double y);
  173. float nextafterf(float x, float y);
  174. long double nextafterl(long double x, long double y);
  175. Returns the next representable floating point number after /x/
  176. in the direction of /y/, or /x/ if `x == y`.
  177. double nexttoward(double x, long double y);
  178. float nexttowardf(float x, long double y);
  179. long double nexttowardl(long double x, long double y);
  180. As `nextafter`, but with /y/ always expressed as a `long double`.
  181. double round(double x);
  182. float roundf(float x);
  183. long double roundl(long double x);
  184. Returns the value /x/ rounded to the nearest integer:
  185. equivalent to `floor(x + 0.5)`
  186. See also __round for the full template (header only) version of this function.
  187. double tgamma(double x);
  188. float tgammaf(float x);
  189. long double tgammal(long double x);
  190. Returns the gamma function of /x/:
  191. [equation gamm1]
  192. See also __tgamma for the full template (header only) version of this function.
  193. double trunc(double x);
  194. float truncf(float x);
  195. long double truncl(long double x);
  196. Returns /x/ truncated to the nearest integer.
  197. See also __trunc for the full template (header only) version of this function.
  198. See also [@http://www.open-std.org/JTC1/SC22/WG14/www/docs/n1124.pdf C99 ISO Standard]
  199. [endsect]
  200. [/
  201. Copyright 2008 John Maddock and Paul A. Bristow.
  202. Distributed under the Boost Software License, Version 1.0.
  203. (See accompanying file LICENSE_1_0.txt or copy at
  204. http://www.boost.org/LICENSE_1_0.txt).
  205. ]