math.h
上传用户:fy98168
上传日期:2015-06-26
资源大小:13771k
文件大小:7k
- /* $Id$ */
- /* math.h: ANSI X3.159 1989 library header, section 4.5 */
- /* Copyright (C) Codemist Ltd. */
- /* Copyright (C) SGS-THOMSON Microelectronics Ltd. 1996 */
- #ifndef __math_h
- #define __math_h
- #ifdef __cplusplus
- extern "C" {
- #endif
- #include <float.h>
- #define HUGE_VAL DBL_MAX
- extern double acos(double /*x*/);
- extern double asin(double /*x*/);
- extern double atan(double /*x*/);
- extern double atan2(double /*y*/, double /*x*/);
- extern double cos(double /*x*/);
- extern double sin(double /*x*/);
- extern double tan(double /*x*/);
- extern double cosh(double /*x*/);
- extern double sinh(double /*x*/);
- extern double tanh(double /*x*/);
- extern double exp(double /*x*/);
- extern double frexp(double /*value*/, int * /*exp*/);
- extern double ldexp(double /*x*/, int /*exp*/);
- extern double log(double /*x*/);
- extern double log10(double /*x*/);
- extern double modf(double /*value*/, double * /*iptr*/);
- extern double pow(double /*x*/, double /*y*/);
- extern double sqrt(double /*x*/);
- extern double ceil(double /*x*/);
- extern double fabs(double /*x*/);
- extern double floor(double /*d*/);
- extern double fmod(double /*x*/, double /*y*/);
- #ifdef __cplusplus
- }
- #endif
- #ifdef __cplusplus
- extern "C++" {
- inline long double acosl(long double _X)
- {return (acos((double)_X)); }
- inline long double asinl(long double _X)
- {return (asin((double)_X)); }
- inline long double atanl(long double _X)
- {return (atan((double)_X)); }
- inline long double atan2l(long double _X, long double _Y)
- {return (atan2((double)_X, (double)_Y)); }
- inline long double ceill(long double _X)
- {return (ceil((double)_X)); }
- inline long double cosl(long double _X)
- {return (cos((double)_X)); }
- inline long double coshl(long double _X)
- {return (cosh((double)_X)); }
- inline long double expl(long double _X)
- {return (exp((double)_X)); }
- inline long double fabsl(long double _X)
- {return (fabs((double)_X)); }
- inline long double floorl(long double _X)
- {return (floor((double)_X)); }
- inline long double fmodl(long double _X, long double _Y)
- {return (fmod((double)_X, (double)_Y)); }
- inline long double frexpl(long double _X, int *_Y)
- {return (frexp((double)_X, _Y)); }
- inline long double ldexpl(long double _X, int _Y)
- {return (ldexp((double)_X, _Y)); }
- inline long double logl(long double _X)
- {return (log((double)_X)); }
- inline long double log10l(long double _X)
- {return (log10((double)_X)); }
- inline long double modfl(long double _X, long double *_Y)
- {double _Di, _Df = modf((double)_X, &_Di);
- *_Y = (long double)_Di;
- return (_Df); }
- inline long double powl(long double _X, long double _Y)
- {return (pow((double)_X, (double)_Y)); }
- inline long double sinl(long double _X)
- {return (sin((double)_X)); }
- inline long double sinhl(long double _X)
- {return (sinh((double)_X)); }
- inline long double sqrtl(long double _X)
- {return (sqrt((double)_X)); }
- inline long double tanl(long double _X)
- {return (tan((double)_X)); }
- inline long double tanhl(long double _X)
- {return (tanh((double)_X)); }
- }
- /* For C++, the user should not have to include mathf.h, so include it now */
- #include <mathf.h>
- extern "C++" {
- inline float acos(float _X)
- {return (acosf(_X)); }
- inline float asin(float _X)
- {return (asinf(_X)); }
- inline float atan(float _X)
- {return (atanf(_X)); }
- inline float atan2(float _X, float _Y)
- {return (atan2f(_X, _Y)); }
- inline float ceil(float _X)
- {return (ceilf(_X)); }
- inline float cos(float _X)
- {return (cosf(_X)); }
- inline float cosh(float _X)
- {return (coshf(_X)); }
- inline float exp(float _X)
- {return (expf(_X)); }
- inline float fabs(float _X)
- {return (fabsf(_X)); }
- inline float floor(float _X)
- {return (floorf(_X)); }
- inline float fmod(float _X, float _Y)
- {return (fmodf(_X, _Y)); }
- inline float frexp(float _X, int *_Y)
- {return (frexpf(_X, _Y)); }
- inline float ldexp(float _X, int _Y)
- {return (ldexpf(_X, _Y)); }
- inline float log(float _X)
- {return (logf(_X)); }
- inline float log10(float _X)
- {return (log10f(_X)); }
- inline float modf(float _X, float *_Y)
- {float _Di, _Df = modff(_X, &_Di);
- *_Y = _Di;
- return (_Df); }
- inline float pow(float _X, int _Y)
- {return (powf(_X, (float)_Y)); }
- inline float pow(float _X, float _Y)
- {return (powf(_X, _Y)); }
- inline float sin(float _X)
- {return (sinf(_X)); }
- inline float sinh(float _X)
- {return (sinhf(_X)); }
- inline float sqrt(float _X)
- {return (sqrtf(_X)); }
- inline float tan(float _X)
- {return (tanf(_X)); }
- inline float tanh(float _X)
- {return (tanhf(_X)); }
-
- inline double pow(double _X, int _Y)
- {return pow(_X, double(_Y));}
- inline float abs(float _X)
- {return (float) fabsf(_X); }
- inline double abs(double _X)
- {return fabs(_X); }
- inline long double abs(long double _X)
- {return fabsl(_X); }
-
- inline long double acos(long double _X)
- {return (acosl(_X)); }
- inline long double asin(long double _X)
- {return (asinl(_X)); }
- inline long double atan(long double _X)
- {return (atanl(_X)); }
- inline long double atan2(long double _X, long double _Y)
- {return (atan2l(_X, _Y)); }
- inline long double ceil(long double _X)
- {return (ceill(_X)); }
- inline long double cos(long double _X)
- {return (cosl(_X)); }
- inline long double cosh(long double _X)
- {return (coshl(_X)); }
- inline long double exp(long double _X)
- {return (expl(_X)); }
- inline long double fabs(long double _X)
- {return (fabsl(_X)); }
- inline long double floor(long double _X)
- {return (floorl(_X)); }
- inline long double fmod(long double _X, long double _Y)
- {return (fmodl(_X, _Y)); }
- inline long double frexp(long double _X, int *_Y)
- {return (frexpl(_X, _Y)); }
- inline long double ldexp(long double _X, int _Y)
- {return (ldexpl(_X, _Y)); }
- inline long double log(long double _X)
- {return (logl(_X)); }
- inline long double log10(long double _X)
- {return (log10l(_X)); }
- inline long double modf(long double _X, long double *_Y)
- {long double _Di, _Df = modfl(_X, &_Di);
- *_Y = _Di;
- return (_Df); }
- inline long double pow(long double _X, int _Y)
- {return (powl(_X, (long double)_Y)); }
- inline long double pow(long double _X, long double _Y)
- {return (powl(_X, _Y)); }
- inline long double sin(long double _X)
- {return (sinl(_X)); }
- inline long double sinh(long double _X)
- {return (sinhl(_X)); }
- inline long double sqrt(long double _X)
- {return (sqrtl(_X)); }
- inline long double tan(long double _X)
- {return (tanl(_X)); }
- inline long double tanh(long double _X)
- {return (tanhl(_X)); }
- }
- #endif
- #endif
- /* end of math.h */