POK
/home/jaouen/pok_official/pok/trunk/libpok/include/libm.h
00001 /*
00002  *                               POK header
00003  * 
00004  * The following file is a part of the POK project. Any modification should
00005  * made according to the POK licence. You CANNOT use this file or a part of
00006  * this file is this part of a file for your own project
00007  *
00008  * For more information on the POK licence, please see our LICENCE FILE
00009  *
00010  * Please follow the coding guidelines described in doc/CODING_GUIDELINES
00011  *
00012  *                                      Copyright (c) 2007-2009 POK team 
00013  *
00014  * Created by julien on Fri Jan 30 13:44:27 2009 
00015  */
00016 
00017 
00018 #ifdef POK_NEEDS_LIBMATH
00019 
00020 #ifndef __POK_LIBM_H__
00021 #define __POK_LIBM_H__
00022 
00023 
00024 #include <types.h>
00025 
00026 struct exception {
00027         int type;
00028         char *name;
00029         double arg1;
00030         double arg2;
00031         double retval;
00032 };
00033 
00034 #define FP_NAN          1
00035 #define FP_INFINITE     2
00036 #define FP_NORMAL       3
00037 #define FP_SUBNORMAL    4
00038 #define FP_ZERO         5
00039 
00040 #define DOMAIN          1
00041 #define SING            2
00042 #define OVERFLOW        3
00043 #define UNDERFLOW       4
00044 #define TLOSS           5
00045 #define PLOSS           6
00046 
00047 
00048 #define fpclassify(x) (sizeof (x) == sizeof(float )  ?  __fpclassifyf((float)(x)) : __fpclassifyd((double)(x)))  
00049 
00050 extern int __fpclassifyf(float      );
00051 extern int __fpclassifyd(double     );
00052 extern int __fpclassify (long double);
00053 
00054 
00055 double   acos(double x);
00056 float    acosf(float x);
00057 double   acosh(double x);
00058 float    acoshf(float x);
00059 double   asin(double x);
00060 float    asinf(float x);
00061 double   asinh(double x);
00062 float    asinhf(float x);
00063 double   atan(double x);
00064 float    atanf(float x);
00065 double   atan2(double y, double x);
00066 float    atan2f(float y, float x);
00067 double   atanh(double x);
00068 float    atanhf(float x);
00069 double   cbrt(double x);
00070 float    cbrtf(float x);
00071 double   ceil(double x);
00072 float    ceilf(float x);
00073 double   copysign(double x, double y);
00074 float    copysignf(float x, float y);
00075 double   cos(double x);
00076 float    cosf(float x);
00077 double   cosh(double x);
00078 float    coshf(float x);
00079 double   drem(double x, double y);
00080 float    dremf(float x, float y);
00081 double   erf(double x);
00082 float    erff(float x);
00083 double   exp(double x);
00084 float    expf(float x);
00085 double   expm1(double x);
00086 float    expm1f(float x);
00087 double   fabs(double x);
00088 float    fabsf(float x);
00089 int      finite(double x);
00090 int      finitef(float x);
00091 double   floor(double x);
00092 float    floorf(float x);
00093 double   frexp(double x, int *eptr);
00094 float    frexpf(float x, int *eptr);
00095 double   gamma(double x);
00096 float    gammaf(float x);
00097 double   gamma_r(double x, int *signgamp);
00098 float    gammaf_r(float x, int *signgamp);
00099 double   hypot(double x, double y);
00100 float    hypotf(float x, float y);
00101 int      ilogb(double x);
00102 int      ilogbf(float x);
00103 int      isinf(double x);
00104 int      isinff(float x);
00105 int      isnan(double x);
00106 int      isnanf(float x);
00107 double   j0(double x);
00108 float    j0f(float x);
00109 double   j1(double x);
00110 float    j1f(float x);
00111 double   jn(int n, double x);
00112 float    jnf(int n, float x);
00113 double   ldexp(double value, int exp0);
00114 float    ldexpf(float value, int exp0);
00115 double   lgamma(double x);
00116 float    lgammaf(float x);
00117 double   lgamma_r(double x, int *signgamp);
00118 float    lgammaf_r(float x, int *signgamp);
00119 double   log(double x);
00120 float    logf(float x);
00121 double   log10(double x);
00122 float    log10f(float x);
00123 double   log2(double x);
00124 float    log2f(float x);
00125 double   logb(double x);
00126 float    logbf(float x);
00127 double   log1p(double x);
00128 float    log1pf(float x);
00129 double   ldexp(double value, int exp0);
00130 float    ldexpf(float value, int exp0);
00131 int      matherr(struct exception *x);
00132 float    modff(float x, float *iptr);
00133 double   modf(double x, double *iptr);
00134 double   nextafter(double x, double y);
00135 float    nextafterf(float x, float y);
00136 double   pow(double x, double y);
00137 float    powf(float x, float y);
00138 double   remainder(double x, double y);
00139 float    remainderf(float x, float y);
00140 #ifdef _SCALB_INT
00141 double   scalb(double x, int fn);
00142 #else
00143 double   scalb(double x, double fn);
00144 #endif
00145 #ifdef _SCALB_INT
00146 float    scalbf(float x, int fn);
00147 #else
00148 float    scalbf(float x, float fn);
00149 #endif
00150 double   rint(double x);
00151 float    rintf(float x);
00152 double   round(double x);
00153 float    roundf(float x);
00154 double   scalbn(double x, int n);
00155 float    scalbnf(float x, int n);
00156 double   significand(double x);
00157 float    significandf(float x);
00158 double   sin(double x);
00159 float    sinf(float x);
00160 double   sinh(double x);
00161 float    sinhf(float x);
00162 double   sqrt(double x);
00163 float    sqrtf(float x);
00164 double   tan(double x);
00165 float    tanf(float x);
00166 double   tanh(double x);
00167 float    tanhf(float x);
00168 double   trunc(double x);
00169 float    truncf(float x);
00170 
00171 #endif
00172 
00173 #endif /* POK_NEEDS_LIBMATH */