1 [section:c99 C99 C Functions]
3 [h4 Supported C99 Functions]
5 namespace boost{ namespace math{ namespace tr1{ extern "C"{
7 typedef unspecified float_t;
8 typedef unspecified double_t;
10 double acosh(double x);
11 float acoshf(float x);
12 long double acoshl(long double x);
14 double asinh(double x);
15 float asinhf(float x);
16 long double asinhl(long double x);
18 double atanh(double x);
19 float atanhf(float x);
20 long double atanhl(long double x);
22 double cbrt(double x);
24 long double cbrtl(long double x);
26 double copysign(double x, double y);
27 float copysignf(float x, float y);
28 long double copysignl(long double x, long double y);
32 long double erfl(long double x);
34 double erfc(double x);
36 long double erfcl(long double x);
38 double expm1(double x);
39 float expm1f(float x);
40 long double expm1l(long double x);
42 double fmax(double x, double y);
43 float fmaxf(float x, float y);
44 long double fmaxl(long double x, long double y);
46 double fmin(double x, double y);
47 float fminf(float x, float y);
48 long double fminl(long double x, long double y);
50 double hypot(double x, double y);
51 float hypotf(float x, float y);
52 long double hypotl(long double x, long double y);
54 double lgamma(double x);
55 float lgammaf(float x);
56 long double lgammal(long double x);
58 long long llround(double x);
59 long long llroundf(float x);
60 long long llroundl(long double x);
62 double log1p(double x);
63 float log1pf(float x);
64 long double log1pl(long double x);
66 long lround(double x);
67 long lroundf(float x);
68 long lroundl(long double x);
70 double nextafter(double x, double y);
71 float nextafterf(float x, float y);
72 long double nextafterl(long double x, long double y);
74 double nexttoward(double x, long double y);
75 float nexttowardf(float x, long double y);
76 long double nexttowardl(long double x, long double y);
78 double round(double x);
79 float roundf(float x);
80 long double roundl(long double x);
82 double tgamma(double x);
83 float tgammaf(float x);
84 long double tgammal(long double x);
86 double trunc(double x);
87 float truncf(float x);
88 long double truncl(long double x);
92 In addition sufficient additional overloads of the `double` versions of the
93 above functions are provided, so that calling the function with any mixture
94 of `float`, `double`, `long double`, or /integer/ arguments is supported, with the
95 return type determined by the __arg_pomotion_rules.
99 acoshf(2.0f); // float version, returns float.
100 acosh(2.0f); // also calls the float version and returns float.
101 acosh(2.0); // double version, returns double.
102 acoshl(2.0L); // long double version, returns a long double.
103 acosh(2.0L); // also calls the long double version.
104 acosh(2); // integer argument is treated as a double, returns double.
108 More detailed descriptions of these functions are available in the
111 typedef unspecified float_t;
112 typedef unspecified double_t;
114 In this implementation `float_t` is the same as type `float`, and
115 `double_t` the same as type `double` unless the preprocessor symbol
116 FLT_EVAL_METHOD is defined, in which case these are set as follows:
119 [[FLT_EVAL_METHOD][float_t][double_t]]
121 [[1][double][double]]
122 [[2][long double][long double]]
125 double acosh(double x);
126 float acoshf(float x);
127 long double acoshl(long double x);
129 Returns the inverse hyperbolic cosine of /x/.
131 See also __acosh for the full template (header only) version of this function.
133 double asinh(double x);
134 float asinhf(float x);
135 long double asinhl(long double x);
137 Returns the inverse hyperbolic sine of /x/.
139 See also __asinh for the full template (header only) version of this function.
141 double atanh(double x);
142 float atanhf(float x);
143 long double atanhl(long double x);
145 Returns the inverse hyperbolic tangent of /x/.
147 See also __atanh for the full template (header only) version of this function.
149 double cbrt(double x);
150 float cbrtf(float x);
151 long double cbrtl(long double x);
153 Returns the cubed root of /x/.
155 See also __cbrt for the full template (header only) version of this function.
157 double copysign(double x, double y);
158 float copysignf(float x, float y);
159 long double copysignl(long double x, long double y);
161 Returns a value with the magnitude of /x/ and the sign of /y/.
163 double erf(double x);
165 long double erfl(long double x);
167 Returns the error function of /x/:
171 See also __erf for the full template (header only) version of this function.
173 double erfc(double x);
174 float erfcf(float x);
175 long double erfcl(long double x);
177 Returns the complementary error function of /x/ `1-erf(x)` without the loss
178 of precision implied by the subtraction.
180 See also __erfc for the full template (header only) version of this function.
182 double expm1(double x);
183 float expm1f(float x);
184 long double expm1l(long double x);
186 Returns `exp(x)-1` without the loss
187 of precision implied by the subtraction.
189 See also __expm1 for the full template (header only) version of this function.
191 double fmax(double x, double y);
192 float fmaxf(float x, float y);
193 long double fmaxl(long double x, long double y);
195 Returns the larger (most positive) of /x/ and /y/.
197 double fmin(double x, double y);
198 float fminf(float x, float y);
199 long double fminl(long double x, long double y);
201 Returns the smaller (most negative) of /x/ and /y/.
203 double hypot(double x, double y);
204 float hypotf(float x, float y);
205 long double hypotl(long double x, long double y);
207 Returns `sqrt(x*x + y*y)` without the danger of numeric overflow
208 implied by that formulation.
210 See also __hypot for the full template (header only) version of this function.
212 double lgamma(double x);
213 float lgammaf(float x);
214 long double lgammal(long double x);
216 Returns the log of the gamma function of /x/.
220 See also __lgamma for the full template (header only) version of this function.
222 long long llround(double x);
223 long long llroundf(float x);
224 long long llroundl(long double x);
226 Returns the value /x/ rounded to the nearest integer as a `long long`:
227 equivalent to `floor(x + 0.5)`
229 See also __llround for the full template (header only) version of this function.
231 double log1p(double x);
232 float log1pf(float x);
233 long double log1pl(long double x);
235 Returns the `log(x+1)` without the loss of precision
236 implied by that formulation.
238 See also __log1p for the full template (header only) version of this function.
240 long lround(double x);
241 long lroundf(float x);
242 long lroundl(long double x);
244 Returns the value /x/ rounded to the nearest integer as a `long`:
245 equivalent to `floor(x + 0.5)`
247 See also __lround for the full template (header only) version of this function.
249 double nextafter(double x, double y);
250 float nextafterf(float x, float y);
251 long double nextafterl(long double x, long double y);
253 Returns the next representable floating point number after /x/
254 in the direction of /y/, or /x/ if `x == y`.
256 double nexttoward(double x, long double y);
257 float nexttowardf(float x, long double y);
258 long double nexttowardl(long double x, long double y);
260 As `nextafter`, but with /y/ always expressed as a `long double`.
262 double round(double x);
263 float roundf(float x);
264 long double roundl(long double x);
266 Returns the value /x/ rounded to the nearest integer:
267 equivalent to `floor(x + 0.5)`
269 See also __round for the full template (header only) version of this function.
271 double tgamma(double x);
272 float tgammaf(float x);
273 long double tgammal(long double x);
275 Returns the gamma function of /x/:
279 See also __tgamma for the full template (header only) version of this function.
281 double trunc(double x);
282 float truncf(float x);
283 long double truncl(long double x);
285 Returns /x/ truncated to the nearest integer.
287 See also __trunc for the full template (header only) version of this function.
289 See also [@http://www.open-std.org/JTC1/SC22/WG14/www/docs/n1124.pdf C99 ISO Standard]
294 Copyright 2008 John Maddock and Paul A. Bristow.
295 Distributed under the Boost Software License, Version 1.0.
296 (See accompanying file LICENSE_1_0.txt or copy at
297 http://www.boost.org/LICENSE_1_0.txt).