1 /* math.h: Floating point math function declarations
3 Copyright (C) 2001 Jesus Calvino-Fraga, jesusc@ieee.org
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
15 You should have received a copy of the GNU Lesser General Public
16 License along with this library; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
19 /* Version 1.0 - Initial release */
24 #define PI 3.1415926536
25 #define TWO_PI 6.2831853071
26 #define HALF_PI 1.5707963268
27 #define QUART_PI 0.7853981634
28 #define iPI 0.3183098862
29 #define iTWO_PI 0.1591549431
30 #define TWO_O_PI 0.6366197724
32 // EPS=B**(-t/2), where B is the radix of the floating-point representation
33 // and there are t base-B digits in the significand. Therefore, for floats
34 // EPS=2**(-12). Also define EPS2=EPS*EPS.
35 #define EPS 244.14062E-6
36 #define EPS2 59.6046E-9
37 #define XMAX 3.402823466E+38
45 /**********************************************
46 * Prototypes for float ANSI C math functions *
47 **********************************************/
49 /* Trigonometric functions */
50 float sinf(const float x);
51 float cosf(const float x);
52 float tanf(const float x);
53 float cotf(const float x);
54 float asinf(const float x);
55 float acosf(const float x);
56 float atanf(const float x);
57 float atan2f(const float x, const float y);
59 /* Hyperbolic functions */
60 float sinhf(const float x);
61 float coshf(const float x);
62 float tanhf(const float x);
64 /* Exponential, logarithmic and power functions */
65 float expf(const float x);
66 float logf(const float x);
67 float log10f(const float x);
68 float powf(const float x, const float y);
69 float sqrtf(const float a);
71 /* Nearest integer, absolute value, and remainder functions */
72 float fabsf(const float x);
73 float frexpf(const float x, int *pw2);
74 float ldexpf(const float x, const int pw2);
76 float floorf(float x);
77 float modff(float x, float * y);
79 #endif /* _INC_MATH */