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