18
18
19
19
20
20
#include <stdarg.h>
21
- #include <math/ consts.h>
21
+ #include <consts.h>
22
22
23
23
24
24
#ifdef __cplusplus
@@ -60,126 +60,126 @@ extern "C" {
60
60
61
61
62
62
/* Returns the cosine of an angle of x radians. */
63
- extern double cos (double x );
63
+ double cos (double x );
64
64
65
65
66
66
/* Returns the sine of an angle of x radians. */
67
- extern double sin (double x );
67
+ double sin (double x );
68
68
69
69
70
70
/* Returns the tangent of an angle of x radians. */
71
- extern double tan (double x );
71
+ double tan (double x );
72
72
73
73
74
74
/* Returns the principal value of the arc cosine of x, expressed in radians. */
75
- extern double acos (double x );
75
+ double acos (double x );
76
76
77
77
78
78
/* Returns the principal value of the arc sine of x, expressed in radians. */
79
- extern double asin (double x );
79
+ double asin (double x );
80
80
81
81
82
82
/* Returns the principal value of the arc tan of x, expressed in radians. */
83
- extern double atan (double x );
83
+ double atan (double x );
84
84
85
85
86
86
/* Returns the principal value of the arc tangent of y/x, expressed in radians. */
87
- extern double atan2 (double y , double x );
87
+ double atan2 (double y , double x );
88
88
89
89
90
90
/* Hyperbolic functions */
91
91
92
92
93
93
/* Returns the hyperbolic cosine of x. */
94
- extern double cosh (double x );
94
+ double cosh (double x );
95
95
96
96
97
97
/* Returns the hyperbolic sine of x. */
98
- extern double sinh (double x );
98
+ double sinh (double x );
99
99
100
100
101
101
/* Returns the hyperbolic tangent of x. */
102
- extern double tanh (double x );
102
+ double tanh (double x );
103
103
104
104
105
105
/* Exponential and logarithmic functions */
106
106
107
107
108
108
/* Returns the base-e exponential function of x, which is e raised to the power x: e^x. */
109
- extern double exp (double x );
109
+ double exp (double x );
110
110
111
111
112
112
/* Breaks the floating point number x into its binary significand
113
113
* (a floating point with an absolute value between 0.5(included) and 1.0(excluded))
114
114
* and an integral exponent for 2. */
115
- extern double frexp (double x , int * exp );
115
+ double frexp (double x , int * exp );
116
116
117
117
118
118
/* Returns the result of multiplying x (the significand) by 2 raised to the power of exp (the exponent). */
119
- extern double ldexp (double x , int exp );
119
+ double ldexp (double x , int exp );
120
120
121
121
122
122
/* Returns the natural logarithm of x. */
123
- extern double log (double x );
123
+ double log (double x );
124
124
125
125
126
126
/* Returns the common (base-2) logarithm of x. */
127
- extern double log2 (double x );
127
+ double log2 (double x );
128
128
129
129
130
130
/* Returns the common (base-10) logarithm of x. */
131
- extern double log10 (double x );
131
+ double log10 (double x );
132
132
133
133
134
134
/* Breaks x into an integral and a fractional part. */
135
- extern double modf (double x , double * intpart );
136
- extern float modff (float x , float * intpart );
135
+ double modf (double x , double * intpart );
136
+ float modff (float x , float * intpart );
137
137
138
138
139
139
/* Power functions */
140
140
141
141
142
142
/* Returns base raised to the power exponent. */
143
- extern double pow (double base , double exponent );
143
+ double pow (double base , double exponent );
144
144
145
145
146
146
/* Returns the square root of x. */
147
- extern double sqrt (double x );
147
+ double sqrt (double x );
148
148
149
149
150
150
/* Rounding and remainder functions */
151
151
152
152
153
153
/* Rounds x upward, returning the smallest integral value that is not less than x. */
154
- extern double ceil (double x );
155
- extern float ceilf (float x );
154
+ double ceil (double x );
155
+ float ceilf (float x );
156
156
157
157
158
158
/* Rounds x downward, returning the largest integral value that is not greater than x. */
159
- extern double floor (double x );
160
- extern float floorf (float x );
159
+ double floor (double x );
160
+ float floorf (float x );
161
161
162
162
163
163
/* Returns the floating-point remainder of numer/denom (rounded towards zero). */
164
- extern double fmod (double numer , double denom );
164
+ double fmod (double numer , double denom );
165
165
166
166
167
167
/* Return the integral value nearest to x */
168
- extern double round (double x );
169
- extern float roundf (float x );
168
+ double round (double x );
169
+ float roundf (float x );
170
170
171
171
172
172
/* Rounds x toward zero, returning the nearest integral value that is not larger in magnitude than x. */
173
- extern double trunc (double x );
174
- extern float truncf (float x );
173
+ double trunc (double x );
174
+ float truncf (float x );
175
175
176
176
177
177
/* Miscellaneous */
178
178
179
179
180
180
/* Returns the absolute value of x: |x|. */
181
- extern double fabs (double x );
182
- extern float fabsf (float x );
181
+ double fabs (double x );
182
+ float fabsf (float x );
183
183
184
184
185
185
/* C99 extensions */
@@ -203,25 +203,6 @@ float sqrtf(float x);
203
203
float fmodf (float num , float denom );
204
204
205
205
206
- #define cosf (x ) ((float)cos(x))
207
- #define sinf (x ) ((float)sin(x))
208
- #define tanf (x ) ((float)tan(x))
209
- #define acosf (x ) ((float)acos(x))
210
- #define asinf (x ) ((float)asin(x))
211
- #define atanf (x ) ((float)atan(x))
212
- #define atan2f (y , x ) ((float)atan2(y, x))
213
- #define coshf (x ) ((float)cosh(x))
214
- #define sinhf (x ) ((float)sinh(x))
215
- #define tanhf (x ) ((float)tanh(x))
216
- #define expf (x ) ((float)exp(x))
217
- #define frexpf (x , exp ) ((float)frexp(x, exp))
218
- #define ldexpf (x , exp ) ((float)ldexp(x, exp))
219
- #define logf (x ) ((float)log(x))
220
- #define log10f (x ) ((float)log10(x))
221
- #define powf (base , exponent ) ((float)pow(base, exponent))
222
- #define fmodf (num , denom ) ((float)fmod(num, denom))
223
-
224
-
225
206
#ifdef __cplusplus
226
207
}
227
208
#endif
0 commit comments