POK
libm.h
1 /*
2  * POK header
3  *
4  * The following file is a part of the POK project. Any modification should
5  * made according to the POK licence. You CANNOT use this file or a part of
6  * this file is this part of a file for your own project
7  *
8  * For more information on the POK licence, please see our LICENCE FILE
9  *
10  * Please follow the coding guidelines described in doc/CODING_GUIDELINES
11  *
12  * Copyright (c) 2007-2009 POK team
13  *
14  * Created by julien on Fri Jan 30 13:44:27 2009
15  */
16 
17 
18 #ifdef POK_NEEDS_LIBMATH
19 
20 #ifndef __POK_LIBM_H__
21 #define __POK_LIBM_H__
22 
23 
24 #include <types.h>
25 
26 struct exception {
27  int type;
28  char *name;
29  double arg1;
30  double arg2;
31  double retval;
32 };
33 
34 #define FP_NAN 1
35 #define FP_INFINITE 2
36 #define FP_NORMAL 3
37 #define FP_SUBNORMAL 4
38 #define FP_ZERO 5
39 
40 #define DOMAIN 1
41 #define SING 2
42 #define OVERFLOW 3
43 #define UNDERFLOW 4
44 #define TLOSS 5
45 #define PLOSS 6
46 
47 
48 #define fpclassify(x) (sizeof (x) == sizeof(float ) ? __fpclassifyf((float)(x)) : __fpclassifyd((double)(x)))
49 
50 extern int __fpclassifyf(float );
51 extern int __fpclassifyd(double );
52 extern int __fpclassify (long double);
53 
54 
55 double acos(double x);
56 float acosf(float x);
57 double acosh(double x);
58 float acoshf(float x);
59 double asin(double x);
60 float asinf(float x);
61 double asinh(double x);
62 float asinhf(float x);
63 double atan(double x);
64 float atanf(float x);
65 double atan2(double y, double x);
66 float atan2f(float y, float x);
67 double atanh(double x);
68 float atanhf(float x);
69 double cbrt(double x);
70 float cbrtf(float x);
71 double ceil(double x);
72 float ceilf(float x);
73 double copysign(double x, double y);
74 float copysignf(float x, float y);
75 double cos(double x);
76 float cosf(float x);
77 double cosh(double x);
78 float coshf(float x);
79 double drem(double x, double y);
80 float dremf(float x, float y);
81 double erf(double x);
82 float erff(float x);
83 double exp(double x);
84 float expf(float x);
85 double expm1(double x);
86 float expm1f(float x);
87 double fabs(double x);
88 float fabsf(float x);
89 int finite(double x);
90 int finitef(float x);
91 double floor(double x);
92 float floorf(float x);
93 double frexp(double x, int *eptr);
94 float frexpf(float x, int *eptr);
95 double gamma(double x);
96 float gammaf(float x);
97 double gamma_r(double x, int *signgamp);
98 float gammaf_r(float x, int *signgamp);
99 double hypot(double x, double y);
100 float hypotf(float x, float y);
101 int ilogb(double x);
102 int ilogbf(float x);
103 int isinf(double x);
104 int isinff(float x);
105 int isnan(double x);
106 int isnanf(float x);
107 double j0(double x);
108 float j0f(float x);
109 double j1(double x);
110 float j1f(float x);
111 double jn(int n, double x);
112 float jnf(int n, float x);
113 double ldexp(double value, int exp0);
114 float ldexpf(float value, int exp0);
115 double lgamma(double x);
116 float lgammaf(float x);
117 double lgamma_r(double x, int *signgamp);
118 float lgammaf_r(float x, int *signgamp);
119 double log(double x);
120 float logf(float x);
121 double log10(double x);
122 float log10f(float x);
123 double log2(double x);
124 float log2f(float x);
125 double logb(double x);
126 float logbf(float x);
127 double log1p(double x);
128 float log1pf(float x);
129 double ldexp(double value, int exp0);
130 float ldexpf(float value, int exp0);
131 int matherr(struct exception *x);
132 float modff(float x, float *iptr);
133 double modf(double x, double *iptr);
134 double nextafter(double x, double y);
135 float nextafterf(float x, float y);
136 double pow(double x, double y);
137 float powf(float x, float y);
138 double remainder(double x, double y);
139 float remainderf(float x, float y);
140 #ifdef _SCALB_INT
141 double scalb(double x, int fn);
142 #else
143 double scalb(double x, double fn);
144 #endif
145 #ifdef _SCALB_INT
146 float scalbf(float x, int fn);
147 #else
148 float scalbf(float x, float fn);
149 #endif
150 double rint(double x);
151 float rintf(float x);
152 double round(double x);
153 float roundf(float x);
154 double scalbn(double x, int n);
155 float scalbnf(float x, int n);
156 double significand(double x);
157 float significandf(float x);
158 double sin(double x);
159 float sinf(float x);
160 double sinh(double x);
161 float sinhf(float x);
162 double sqrt(double x);
163 float sqrtf(float x);
164 double tan(double x);
165 float tanf(float x);
166 double tanh(double x);
167 float tanhf(float x);
168 double trunc(double x);
169 float truncf(float x);
170 
171 #endif
172 
173 #endif /* POK_NEEDS_LIBMATH */