00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034 #ifndef _ABLE_CLIB_MATH_H
00035 #define _ABLE_CLIB_MATH_H 1
00036
00037 extern int __isnanf(float);
00038 extern int __isnan(double);
00039 extern int __isinf(double);
00040
00041 #define isnanf __isnanf
00042 #define isinff __isinff
00043 #define finitef __finitef
00044
00045 enum
00046 {
00047 FP_NAN,
00048 # define FP_NAN FP_NAN
00049 FP_INFINITE,
00050 # define FP_INFINITE FP_INFINITE
00051 FP_ZERO,
00052 # define FP_ZERO FP_ZERO
00053 FP_SUBNORMAL,
00054 # define FP_SUBNORMAL FP_SUBNORMAL
00055 FP_NORMAL
00056 # define FP_NORMAL FP_NORMAL
00057 };
00058
00059 #define fpclassify(x) \
00060 ((sizeof (x) == sizeof (float)) ? __fpclassifyf(x) \
00061 : (sizeof (x) == sizeof (double)) ? __fpclassifyd(x) \
00062 : __fpclassifyl(x))
00063
00064 #define isfinite(x) \
00065 ((sizeof (x) == sizeof (float)) ? __isfinitef(x) \
00066 : (sizeof (x) == sizeof (double)) ? __isfinite(x) \
00067 : __isfinitel(x))
00068
00069 #define isinf(x) \
00070 ((sizeof (x) == sizeof (float)) ? __isinff(x) \
00071 : (sizeof (x) == sizeof (double)) ? __isinf(x) \
00072 : __isinfl(x))
00073
00074 #define isnan(x) \
00075 ((sizeof (x) == sizeof (float)) ? __isnanf(x) \
00076 : (sizeof (x) == sizeof (double)) ? __isnan(x) \
00077 : __isnanl(x))
00078
00079 #define isnormal(x) \
00080 ((sizeof (x) == sizeof (float)) ? __isnormalf(x) \
00081 : (sizeof (x) == sizeof (double)) ? __isnormal(x) \
00082 : __isnormall(x))
00083
00084 int (isinf)(double);
00085 int (isnan)(double);
00086
00087 #define __huge_val_bytes { 0, 0, 0, 0, 0, 0, 0xf0, 0x7f }
00088
00089 #define HUGE_VAL \
00090 (__extension__ ((union { unsigned char __c[8]; \
00091 double __d; }) \
00092 { __huge_val_bytes }).__d)
00093
00094
00095
00096 #define M_E 2.7182818284590452354
00097 #define M_LOG2E 1.4426950408889634074
00098 #define M_LOG10E 0.43429448190325182765
00099 #define M_LN2 0.69314718055994530942
00100 #define M_LN10 2.30258509299404568402
00101 #define M_PI 3.14159265358979323846
00102 #define M_PI_2 1.57079632679489661923
00103 #define M_PI_4 0.78539816339744830962
00104 #define M_1_PI 0.31830988618379067154
00105 #define M_2_PI 0.63661977236758134308
00106 #define M_2_SQRTPI 1.12837916709551257390
00107 #define M_SQRT2 1.41421356237309504880
00108 #define M_SQRT1_2 0.70710678118654752440
00109
00110 #define MAXFLOAT ((float)3.40282346638528860e+38)
00111
00112 #define HUGE MAXFLOAT
00113
00114 #define X_TLOSS 1.41484755040568800000e+16
00115
00116 #define DOMAIN 1
00117 #define SING 2
00118 #define OVERFLOW 3
00119 #define UNDERFLOW 4
00120 #define TLOSS 5
00121 #define PLOSS 6
00122
00123
00124
00125
00126 #ifndef __cplusplus
00127 struct exception {
00128 int type;
00129 const char *name;
00130 double arg1;
00131 double arg2;
00132 double retval;
00133 };
00134 #endif
00135
00136 int matherr(struct exception *);
00137
00138 enum fdversion {fdlibm_ieee = -1, fdlibm_svid, fdlibm_xopen, fdlibm_posix};
00139
00140 #define _LIB_VERSION_TYPE enum fdversion
00141 #define _LIB_VERSION _fdlib_version
00142
00143 extern _LIB_VERSION_TYPE _LIB_VERSION;
00144
00145 #define _IEEE_ fdlibm_ieee
00146 #define _SVID_ fdlibm_svid
00147 #define _XOPEN_ fdlibm_xopen
00148 #define _POSIX_ fdlibm_posix
00149
00150
00151
00152
00153 int __fpclassifyd(double);
00154 int __fpclassifyf(float);
00155 int __fpclassifyl(long double);
00156 int __isfinitef(float);
00157 int __isfinite(double);
00158 int __isfinitel(long double);
00159 int __isinff(float);
00160 int __isinfl(long double);
00161 int __isnanl(long double);
00162 int __isnormalf(float);
00163 int __isnormal(double);
00164 int __isnormall(long double);
00165 int __signbit(double);
00166 int __signbitf(float);
00167 int __signbitl(long double);
00168
00169
00170 int finite(double x);
00171 int finitef(float);
00172 int finitel(long double x);
00173
00174
00175 float acosf(float);
00176 float asinf(float);
00177 float atanf(float);
00178 float atan2f(float, float);
00179 float cosf(float);
00180 float sinf(float);
00181 float tanf(float);
00182
00183 float coshf(float);
00184 float sinhf(float);
00185 float tanhf(float);
00186
00187 float expf(float);
00188 float expm1f(float);
00189 float frexpf(float, int *);
00190 int ilogbf(float);
00191 float ldexpf(float, int);
00192 float log10f(float);
00193 float log1pf(float);
00194 float logf(float);
00195 float modff(float, float *);
00196
00197 float powf(float, float);
00198 float sqrtf(float);
00199
00200 float ceilf(float);
00201 float fabsf(float);
00202 float floorf(float);
00203 float fmodf(float, float);
00204 float roundf(float);
00205
00206 float erff(float);
00207 float erfcf(float);
00208 float hypotf(float, float);
00209
00210 float acoshf(float);
00211 float asinhf(float);
00212 float atanhf(float);
00213 float cbrtf(float);
00214 float logbf(float);
00215 float copysignf(float, float);
00216 float nearbyintf(float);
00217 float nextafterf(float, float);
00218 float remainderf(float, float);
00219 float rintf(float);
00220 float scalblnf(float, long);
00221 float scalbnf(float, int);
00222 float truncf(float);
00223
00224 float fdimf(float, float);
00225 float fmaxf(float, float);
00226 float fminf(float, float);
00227
00228 float dremf(float, float);
00229
00230 float gammaf(float);
00231 float gammaf_r(float x, int *signgamp);
00232 float lgammaf(float);
00233 float lgammaf_r(float x, int *signp);
00234
00235 float j0f(float);
00236 float j1f(float);
00237 float jnf(int, float);
00238 float scalbf(float, float);
00239 float y0f(float);
00240 float y1f(float);
00241 float ynf(int, float);
00242
00243 float significandf(float x);
00244
00245
00246
00247 double acos(double);
00248 double asin(double);
00249 double atan(double);
00250 double atan2(double, double);
00251 double cos(double);
00252 double sin(double);
00253 double tan(double);
00254
00255 double cosh(double);
00256 double sinh(double);
00257 double tanh(double);
00258
00259 double exp(double);
00260 double frexp(double, int *);
00261 double ldexp(double, int);
00262 double log(double);
00263 double log10(double);
00264 double modf(double, double *);
00265
00266 double pow(double, double);
00267 double sqrt(double);
00268
00269 double ceil(double);
00270 double fabs(double);
00271 double floor(double);
00272 double fmod(double, double);
00273
00274 double acosh(double);
00275 double asinh(double);
00276 double atanh(double);
00277 double cbrt(double) ;
00278 double erf(double);
00279 double erfc(double) ;
00280 double expm1(double) ;
00281 double hypot(double, double);
00282 int ilogb(double);
00283 double lgamma(double);
00284 double lgamma_r(double x, int *signp);
00285 double log1p(double) ;
00286 double logb(double) ;
00287 double nextafter(double, double);
00289 double remainder(double, double);
00294 double drem(double x, double y);
00295 double rint(double) ;
00296 double copysign(double, double) ;
00297 double fdim(double, double);
00298 double fmax(double, double) ;
00299 double fmin(double, double) ;
00300 double nearbyint(double) ;
00301 double round(double);
00302 double scalbln(double, long);
00303 double scalbn(double, int);
00304 double tgamma(double);
00305 double trunc(double);
00306 double scalb(double x, double exp);
00307 double gamma(double x);
00308 double gamma_r(double x, int *signgamp);
00309
00310
00311 double j0(double x);
00312 double j1(double x);
00313 double jn(int n, double x);
00314 double y0(double x);
00315 double y1(double x);
00316 double yn(int n, double x);
00317
00318 double significand(double x);
00319
00321 long double copysignl(long double x, long double y);
00322
00324 long double fabsl(long double);
00325
00326 long double significandl(long double x);
00327
00328 long double fmaxl(long double x, long double y);
00329 long double fminl(long double x, long double y);
00330 long double fdiml(long double x, long double y);
00331
00332 #endif