123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299 |
- [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).
- ]
|