Mercurial > projects > ldc
comparison druntime/import/core/stdc/math.d @ 1458:e0b2d67cfe7c
Added druntime (this should be removed once it works).
author | Robert Clipsham <robert@octarineparrot.com> |
---|---|
date | Tue, 02 Jun 2009 17:43:06 +0100 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
1456:7b218ec1044f | 1458:e0b2d67cfe7c |
---|---|
1 /** | |
2 * D header file for C99. | |
3 * | |
4 * Copyright: Copyright Sean Kelly 2005 - 2009. | |
5 * License: <a href="http://www.boost.org/LICENSE_1_0.txt>Boost License 1.0</a>. | |
6 * Authors: Sean Kelly | |
7 * Standards: ISO/IEC 9899:1999 (E) | |
8 * | |
9 * Copyright Sean Kelly 2005 - 2009. | |
10 * Distributed under the Boost Software License, Version 1.0. | |
11 * (See accompanying file LICENSE_1_0.txt or copy at | |
12 * http://www.boost.org/LICENSE_1_0.txt) | |
13 */ | |
14 module core.stdc.math; | |
15 | |
16 private import core.stdc.config; | |
17 | |
18 extern (C): | |
19 | |
20 alias float float_t; | |
21 alias double double_t; | |
22 | |
23 enum double HUGE_VAL = double.infinity; | |
24 enum double HUGE_VALF = float.infinity; | |
25 enum double HUGE_VALL = real.infinity; | |
26 | |
27 enum float INFINITY = float.infinity; | |
28 enum float NAN = float.nan; | |
29 | |
30 enum int FP_ILOGB0 = int.min; | |
31 enum int FP_ILOGBNAN = int.min; | |
32 | |
33 enum int MATH_ERRNO = 1; | |
34 enum int MATH_ERREXCEPT = 2; | |
35 enum int math_errhandling = MATH_ERRNO | MATH_ERREXCEPT; | |
36 | |
37 version( none ) | |
38 { | |
39 // | |
40 // these functions are all macros in C | |
41 // | |
42 | |
43 //int fpclassify(real-floating x); | |
44 int fpclassify(float x); | |
45 int fpclassify(double x); | |
46 int fpclassify(real x); | |
47 | |
48 //int isfinite(real-floating x); | |
49 int isfinite(float x); | |
50 int isfinite(double x); | |
51 int isfinite(real x); | |
52 | |
53 //int isinf(real-floating x); | |
54 int isinf(float x); | |
55 int isinf(double x); | |
56 int isinf(real x); | |
57 | |
58 //int isnan(real-floating x); | |
59 int isnan(float x); | |
60 int isnan(double x); | |
61 int isnan(real x); | |
62 | |
63 //int isnormal(real-floating x); | |
64 int isnormal(float x); | |
65 int isnormal(double x); | |
66 int isnormal(real x); | |
67 | |
68 //int signbit(real-floating x); | |
69 int signbit(float x); | |
70 int signbit(double x); | |
71 int signbit(real x); | |
72 | |
73 //int isgreater(real-floating x, real-floating y); | |
74 int isgreater(float x, float y); | |
75 int isgreater(double x, double y); | |
76 int isgreater(real x, real y); | |
77 | |
78 //int isgreaterequal(real-floating x, real-floating y); | |
79 int isgreaterequal(float x, float y); | |
80 int isgreaterequal(double x, double y); | |
81 int isgreaterequal(real x, real y); | |
82 | |
83 //int isless(real-floating x, real-floating y); | |
84 int isless(float x, float y); | |
85 int isless(double x, double y); | |
86 int isless(real x, real y); | |
87 | |
88 //int islessequal(real-floating x, real-floating y); | |
89 int islessequal(float x, float y); | |
90 int islessequal(double x, double y); | |
91 int islessequal(real x, real y); | |
92 | |
93 //int islessgreater(real-floating x, real-floating y); | |
94 int islessgreater(float x, float y); | |
95 int islessgreater(double x, double y); | |
96 int islessgreater(real x, real y); | |
97 | |
98 //int isunordered(real-floating x, real-floating y); | |
99 int isunordered(float x, float y); | |
100 int isunordered(double x, double y); | |
101 int isunordered(real x, real y); | |
102 } | |
103 | |
104 version( DigitalMars ) version( Windows ) | |
105 version = DigitalMarsWin32; | |
106 | |
107 version( DigitalMarsWin32 ) | |
108 { | |
109 enum | |
110 { | |
111 FP_NANS = 0, | |
112 FP_NANQ = 1, | |
113 FP_INFINITE = 2, | |
114 FP_NORMAL = 3, | |
115 FP_SUBNORMAL = 4, | |
116 FP_ZERO = 5, | |
117 FP_NAN = FP_NANQ, | |
118 FP_EMPTY = 6, | |
119 FP_UNSUPPORTED = 7, | |
120 } | |
121 | |
122 enum | |
123 { | |
124 FP_FAST_FMA = 0, | |
125 FP_FAST_FMAF = 0, | |
126 FP_FAST_FMAL = 0, | |
127 } | |
128 | |
129 uint __fpclassify_f(float x); | |
130 uint __fpclassify_d(double x); | |
131 uint __fpclassify_ld(real x); | |
132 | |
133 extern (D) | |
134 { | |
135 //int fpclassify(real-floating x); | |
136 int fpclassify(float x) { return __fpclassify_f(x); } | |
137 int fpclassify(double x) { return __fpclassify_d(x); } | |
138 int fpclassify(real x) | |
139 { | |
140 return (real.sizeof == double.sizeof) | |
141 ? __fpclassify_d(x) | |
142 : __fpclassify_ld(x); | |
143 } | |
144 | |
145 //int isfinite(real-floating x); | |
146 int isfinite(float x) { return fpclassify(x) >= FP_NORMAL; } | |
147 int isfinite(double x) { return fpclassify(x) >= FP_NORMAL; } | |
148 int isfinite(real x) { return fpclassify(x) >= FP_NORMAL; } | |
149 | |
150 //int isinf(real-floating x); | |
151 int isinf(float x) { return fpclassify(x) == FP_INFINITE; } | |
152 int isinf(double x) { return fpclassify(x) == FP_INFINITE; } | |
153 int isinf(real x) { return fpclassify(x) == FP_INFINITE; } | |
154 | |
155 //int isnan(real-floating x); | |
156 int isnan(float x) { return fpclassify(x) <= FP_NANQ; } | |
157 int isnan(double x) { return fpclassify(x) <= FP_NANQ; } | |
158 int isnan(real x) { return fpclassify(x) <= FP_NANQ; } | |
159 | |
160 //int isnormal(real-floating x); | |
161 int isnormal(float x) { return fpclassify(x) == FP_NORMAL; } | |
162 int isnormal(double x) { return fpclassify(x) == FP_NORMAL; } | |
163 int isnormal(real x) { return fpclassify(x) == FP_NORMAL; } | |
164 | |
165 //int signbit(real-floating x); | |
166 int signbit(float x) { return (cast(short*)&(x))[1] & 0x8000; } | |
167 int signbit(double x) { return (cast(short*)&(x))[3] & 0x8000; } | |
168 int signbit(real x) | |
169 { | |
170 return (real.sizeof == double.sizeof) | |
171 ? (cast(short*)&(x))[3] & 0x8000 | |
172 : (cast(short*)&(x))[4] & 0x8000; | |
173 } | |
174 } | |
175 } | |
176 else version( linux ) | |
177 { | |
178 enum | |
179 { | |
180 FP_NAN, | |
181 FP_INFINITE, | |
182 FP_ZERO, | |
183 FP_SUBNORMAL, | |
184 FP_NORMAL, | |
185 } | |
186 | |
187 enum | |
188 { | |
189 FP_FAST_FMA = 0, | |
190 FP_FAST_FMAF = 0, | |
191 FP_FAST_FMAL = 0, | |
192 } | |
193 | |
194 int __fpclassifyf(float x); | |
195 int __fpclassify(double x); | |
196 int __fpclassifyl(real x); | |
197 | |
198 int __finitef(float x); | |
199 int __finite(double x); | |
200 int __finitel(real x); | |
201 | |
202 int __isinff(float x); | |
203 int __isinf(double x); | |
204 int __isinfl(real x); | |
205 | |
206 int __isnanf(float x); | |
207 int __isnan(double x); | |
208 int __isnanl(real x); | |
209 | |
210 int __signbitf(float x); | |
211 int __signbit(double x); | |
212 int __signbitl(real x); | |
213 | |
214 extern (D) | |
215 { | |
216 //int fpclassify(real-floating x); | |
217 int fpclassify(float x) { return __fpclassifyf(x); } | |
218 int fpclassify(double x) { return __fpclassify(x); } | |
219 int fpclassify(real x) | |
220 { | |
221 return (real.sizeof == double.sizeof) | |
222 ? __fpclassify(x) | |
223 : __fpclassifyl(x); | |
224 } | |
225 | |
226 //int isfinite(real-floating x); | |
227 int isfinite(float x) { return __finitef(x); } | |
228 int isfinite(double x) { return __finite(x); } | |
229 int isfinite(real x) | |
230 { | |
231 return (real.sizeof == double.sizeof) | |
232 ? __finite(x) | |
233 : __finitel(x); | |
234 } | |
235 | |
236 //int isinf(real-floating x); | |
237 int isinf(float x) { return __isinff(x); } | |
238 int isinf(double x) { return __isinf(x); } | |
239 int isinf(real x) | |
240 { | |
241 return (real.sizeof == double.sizeof) | |
242 ? __isinf(x) | |
243 : __isinfl(x); | |
244 } | |
245 | |
246 //int isnan(real-floating x); | |
247 int isnan(float x) { return __isnanf(x); } | |
248 int isnan(double x) { return __isnan(x); } | |
249 int isnan(real x) | |
250 { | |
251 return (real.sizeof == double.sizeof) | |
252 ? __isnan(x) | |
253 : __isnanl(x); | |
254 } | |
255 | |
256 //int isnormal(real-floating x); | |
257 int isnormal(float x) { return fpclassify(x) == FP_NORMAL; } | |
258 int isnormal(double x) { return fpclassify(x) == FP_NORMAL; } | |
259 int isnormal(real x) { return fpclassify(x) == FP_NORMAL; } | |
260 | |
261 //int signbit(real-floating x); | |
262 int signbit(float x) { return __signbitf(x); } | |
263 int signbit(double x) { return __signbit(x); } | |
264 int signbit(real x) | |
265 { | |
266 return (real.sizeof == double.sizeof) | |
267 ? __signbit(x) | |
268 : __signbitl(x); | |
269 } | |
270 } | |
271 } | |
272 else version( OSX ) | |
273 { | |
274 enum | |
275 { | |
276 FP_NAN = 1, | |
277 FP_INFINITE = 2, | |
278 FP_ZERO = 3, | |
279 FP_NORMAL = 4, | |
280 FP_SUBNORMAL = 5, | |
281 FP_SUPERNORMAL = 6, | |
282 } | |
283 | |
284 enum | |
285 { | |
286 FP_FAST_FMA = 0, | |
287 FP_FAST_FMAF = 0, | |
288 FP_FAST_FMAL = 0, | |
289 } | |
290 | |
291 int __fpclassifyf(float x); | |
292 int __fpclassifyd(double x); | |
293 int __fpclassify(real x); | |
294 | |
295 int __isfinitef(float x); | |
296 int __isfinited(double x); | |
297 int __isfinite(real x); | |
298 | |
299 int __isinff(float x); | |
300 int __isinfd(double x); | |
301 int __isinf(real x); | |
302 | |
303 int __isnanf(float x); | |
304 int __isnand(double x); | |
305 int __isnan(real x); | |
306 | |
307 int __signbitf(float x); | |
308 int __signbitd(double x); | |
309 int __signbitl(real x); | |
310 | |
311 extern (D) | |
312 { | |
313 //int fpclassify(real-floating x); | |
314 int fpclassify(float x) { return __fpclassifyf(x); } | |
315 int fpclassify(double x) { return __fpclassifyd(x); } | |
316 int fpclassify(real x) | |
317 { | |
318 return (real.sizeof == double.sizeof) | |
319 ? __fpclassifyd(x) | |
320 : __fpclassify(x); | |
321 } | |
322 | |
323 //int isfinite(real-floating x); | |
324 int isfinite(float x) { return __isfinitef(x); } | |
325 int isfinite(double x) { return __isfinited(x); } | |
326 int isfinite(real x) | |
327 { | |
328 return (real.sizeof == double.sizeof) | |
329 ? __isfinited(x) | |
330 : __isfinite(x); | |
331 } | |
332 | |
333 //int isinf(real-floating x); | |
334 int isinf(float x) { return __isinff(x); } | |
335 int isinf(double x) { return __isinfd(x); } | |
336 int isinf(real x) | |
337 { | |
338 return (real.sizeof == double.sizeof) | |
339 ? __isinfd(x) | |
340 : __isinf(x); | |
341 } | |
342 | |
343 //int isnan(real-floating x); | |
344 int isnan(float x) { return __isnanf(x); } | |
345 int isnan(double x) { return __isnand(x); } | |
346 int isnan(real x) | |
347 { | |
348 return (real.sizeof == double.sizeof) | |
349 ? __isnand(x) | |
350 : __isnan(x); | |
351 } | |
352 | |
353 //int isnormal(real-floating x); | |
354 int isnormal(float x) { return fpclassify(x) == FP_NORMAL; } | |
355 int isnormal(double x) { return fpclassify(x) == FP_NORMAL; } | |
356 int isnormal(real x) { return fpclassify(x) == FP_NORMAL; } | |
357 | |
358 //int signbit(real-floating x); | |
359 int signbit(float x) { return __signbitf(x); } | |
360 int signbit(double x) { return __signbitd(x); } | |
361 int signbit(real x) | |
362 { | |
363 return (real.sizeof == double.sizeof) | |
364 ? __signbitd(x) | |
365 : __signbitl(x); | |
366 } | |
367 } | |
368 } | |
369 else version( freebsd ) | |
370 { | |
371 enum | |
372 { | |
373 FP_INFINITE = 0x01, | |
374 FP_NAN = 0x02, | |
375 FP_NORMAL = 0x04, | |
376 FP_SUBNORMAL = 0x08, | |
377 FP_ZERO = 0x10, | |
378 } | |
379 | |
380 enum | |
381 { | |
382 FP_FAST_FMA = 0, | |
383 FP_FAST_FMAF = 0, | |
384 FP_FAST_FMAL = 0, | |
385 } | |
386 | |
387 int __fpclassifyd(double); | |
388 int __fpclassifyf(float); | |
389 int __fpclassifyl(real); | |
390 int __isfinitef(float); | |
391 int __isfinite(double); | |
392 int __isfinitel(real); | |
393 int __isinff(float); | |
394 int __isinfl(real); | |
395 int __isnanl(real); | |
396 int __isnormalf(float); | |
397 int __isnormal(double); | |
398 int __isnormall(real); | |
399 int __signbit(double); | |
400 int __signbitf(float); | |
401 int __signbitl(real); | |
402 | |
403 extern (D) | |
404 { | |
405 //int fpclassify(real-floating x); | |
406 int fpclassify(float x) { return __fpclassifyf(x); } | |
407 int fpclassify(double x) { return __fpclassifyd(x); } | |
408 int fpclassify(real x) { return __fpclassifyl(x); } | |
409 | |
410 //int isfinite(real-floating x); | |
411 int isfinite(float x) { return __isfinitef(x); } | |
412 int isfinite(double x) { return __isfinite(x); } | |
413 int isfinite(real x) { return __isfinitel(x); } | |
414 | |
415 //int isinf(real-floating x); | |
416 int isinf(float x) { return __isinff(x); } | |
417 int isinf(double x) { return __isinfl(x); } | |
418 int isinf(real x) { return __isinfl(x); } | |
419 | |
420 //int isnan(real-floating x); | |
421 int isnan(float x) { return __isnanl(x); } | |
422 int isnan(double x) { return __isnanl(x); } | |
423 int isnan(real x) { return __isnanl(x); } | |
424 | |
425 //int isnormal(real-floating x); | |
426 int isnormal(float x) { return __isnormalf(x); } | |
427 int isnormal(double x) { return __isnormal(x); } | |
428 int isnormal(real x) { return __isnormall(x); } | |
429 | |
430 //int signbit(real-floating x); | |
431 int signbit(float x) { return __signbitf(x); } | |
432 int signbit(double x) { return __signbit(x); } | |
433 int signbit(real x) { return __signbit(x); } | |
434 } | |
435 } | |
436 | |
437 extern (D) | |
438 { | |
439 //int isgreater(real-floating x, real-floating y); | |
440 int isgreater(float x, float y) { return !(x !> y); } | |
441 int isgreater(double x, double y) { return !(x !> y); } | |
442 int isgreater(real x, real y) { return !(x !> y); } | |
443 | |
444 //int isgreaterequal(real-floating x, real-floating y); | |
445 int isgreaterequal(float x, float y) { return !(x !>= y); } | |
446 int isgreaterequal(double x, double y) { return !(x !>= y); } | |
447 int isgreaterequal(real x, real y) { return !(x !>= y); } | |
448 | |
449 //int isless(real-floating x, real-floating y); | |
450 int isless(float x, float y) { return !(x !< y); } | |
451 int isless(double x, double y) { return !(x !< y); } | |
452 int isless(real x, real y) { return !(x !< y); } | |
453 | |
454 //int islessequal(real-floating x, real-floating y); | |
455 int islessequal(float x, float y) { return !(x !<= y); } | |
456 int islessequal(double x, double y) { return !(x !<= y); } | |
457 int islessequal(real x, real y) { return !(x !<= y); } | |
458 | |
459 //int islessgreater(real-floating x, real-floating y); | |
460 int islessgreater(float x, float y) { return !(x !<> y); } | |
461 int islessgreater(double x, double y) { return !(x !<> y); } | |
462 int islessgreater(real x, real y) { return !(x !<> y); } | |
463 | |
464 //int isunordered(real-floating x, real-floating y); | |
465 int isunordered(float x, float y) { return (x !<>= y); } | |
466 int isunordered(double x, double y) { return (x !<>= y); } | |
467 int isunordered(real x, real y) { return (x !<>= y); } | |
468 } | |
469 | |
470 // NOTE: freebsd < 8-CURRENT doesn't appear to support *l, but we can | |
471 // approximate. | |
472 version( freebsd ) | |
473 { | |
474 double acos(double x); | |
475 float acosf(float x); | |
476 real acosl(real x) { return acos(x); } | |
477 | |
478 double asin(double x); | |
479 float asinf(float x); | |
480 real asinl(real x) { return asin(x); } | |
481 | |
482 double atan(double x); | |
483 float atanf(float x); | |
484 real atanl(real x) { return atan(x); } | |
485 | |
486 double atan2(double y, double x); | |
487 float atan2f(float y, float x); | |
488 real atan2l(real y, real x) { return atan2(y, x); } | |
489 | |
490 double cos(double x); | |
491 float cosf(float x); | |
492 real cosl(real x) { return cos(x); } | |
493 | |
494 double sin(double x); | |
495 float sinf(float x); | |
496 real sinl(real x) { return sin(x); } | |
497 | |
498 double tan(double x); | |
499 float tanf(float x); | |
500 real tanl(real x) { return tan(x); } | |
501 | |
502 double acosh(double x); | |
503 float acoshf(float x); | |
504 real acoshl(real x) { return acosh(x); } | |
505 | |
506 double asinh(double x); | |
507 float asinhf(float x); | |
508 real asinhl(real x) { return asinh(x); } | |
509 | |
510 double atanh(double x); | |
511 float atanhf(float x); | |
512 real atanhl(real x) { return atanh(x); } | |
513 | |
514 double cosh(double x); | |
515 float coshf(float x); | |
516 real coshl(real x) { return cosh(x); } | |
517 | |
518 double sinh(double x); | |
519 float sinhf(float x); | |
520 real sinhl(real x) { return sinh(x); } | |
521 | |
522 double tanh(double x); | |
523 float tanhf(float x); | |
524 real tanhl(real x) { return tanh(x); } | |
525 | |
526 double exp(double x); | |
527 float expf(float x); | |
528 real expl(real x) { return exp(x); } | |
529 | |
530 double exp2(double x); | |
531 float exp2f(float x); | |
532 real exp2l(real x) { return exp2(x); } | |
533 | |
534 double expm1(double x); | |
535 float expm1f(float x); | |
536 real expm1l(real x) { return expm1(x); } | |
537 | |
538 double frexp(double value, int* exp); | |
539 float frexpf(float value, int* exp); | |
540 real frexpl(real value, int* exp) { return frexp(value, exp); } | |
541 | |
542 int ilogb(double x); | |
543 int ilogbf(float x); | |
544 int ilogbl(real x) { return ilogb(x); } | |
545 | |
546 double ldexp(double x, int exp); | |
547 float ldexpf(float x, int exp); | |
548 real ldexpl(real x, int exp) { return ldexp(x, exp); } | |
549 | |
550 double log(double x); | |
551 float logf(float x); | |
552 real logl(real x) { return log(x); } | |
553 | |
554 double log10(double x); | |
555 float log10f(float x); | |
556 real log10l(real x) { return log10(x); } | |
557 | |
558 double log1p(double x); | |
559 float log1pf(float x); | |
560 real log1pl(real x) { return log1p(x); } | |
561 | |
562 private enum real ONE_LN2 = 1 / 0x1.62e42fefa39ef358p-1L; | |
563 double log2(double x) { return log(x) * ONE_LN2; } | |
564 float log2f(float x) { return logf(x) * ONE_LN2; } | |
565 real log2l(real x) { return logl(x) * ONE_LN2; } | |
566 | |
567 double logb(double x); | |
568 float logbf(float x); | |
569 real logbl(real x) { return logb(x); } | |
570 | |
571 double modf(double value, double* iptr); | |
572 float modff(float value, float* iptr); | |
573 //real modfl(real value, real *iptr); // nontrivial conversion | |
574 | |
575 double scalbn(double x, int n); | |
576 float scalbnf(float x, int n); | |
577 real scalbnl(real x, int n) { return scalbn(x, n); } | |
578 | |
579 double scalbln(double x, c_long n); | |
580 float scalblnf(float x, c_long n); | |
581 real scalblnl(real x, c_long n) { return scalbln(x, n); } | |
582 | |
583 | |
584 double cbrt(double x); | |
585 float cbrtf(float x); | |
586 real cbrtl(real x) { return cbrt(x); } | |
587 | |
588 double fabs(double x); | |
589 float fabsf(float x); | |
590 real fabsl(real x) { return fabs(x); } | |
591 | |
592 double hypot(double x, double y); | |
593 float hypotf(float x, float y); | |
594 real hypotl(real x, real y) { return hypot(x, y); } | |
595 | |
596 double pow(double x, double y); | |
597 float powf(float x, float y); | |
598 real powl(real x, real y) { return pow(x, y); } | |
599 | |
600 double sqrt(double x); | |
601 float sqrtf(float x); | |
602 real sqrtl(real x) { return sqrt(x); } | |
603 | |
604 double erf(double x); | |
605 float erff(float x); | |
606 real erfl(real x) { return erf(x); } | |
607 | |
608 double erfc(double x); | |
609 float erfcf(float x); | |
610 real erfcl(real x) { return erfc(x); } | |
611 | |
612 double lgamma(double x); | |
613 float lgammaf(float x); | |
614 real lgammal(real x) { return lgamma(x); } | |
615 | |
616 double tgamma(double x); | |
617 float tgammaf(float x); | |
618 real tgammal(real x) { return tgamma(x); } | |
619 | |
620 double ceil(double x); | |
621 float ceilf(float x); | |
622 real ceill(real x) { return ceil(x); } | |
623 | |
624 double floor(double x); | |
625 float floorf(float x); | |
626 real floorl(real x) { return floor(x); } | |
627 | |
628 double nearbyint(double x); | |
629 float nearbyintf(float x); | |
630 real nearbyintl(real x) { return nearbyint(x); } | |
631 | |
632 double rint(double x); | |
633 float rintf(float x); | |
634 real rintl(real x) { return rint(x); } | |
635 | |
636 c_long lrint(double x); | |
637 c_long lrintf(float x); | |
638 c_long lrintl(real x) { return lrint(x); } | |
639 | |
640 long llrint(double x); | |
641 long llrintf(float x); | |
642 long llrintl(real x) { return llrint(x); } | |
643 | |
644 double round(double x); | |
645 float roundf(float x); | |
646 real roundl(real x) { return round(x); } | |
647 | |
648 c_long lround(double x); | |
649 c_long lroundf(float x); | |
650 c_long lroundl(real x) { return lround(x); } | |
651 | |
652 long llround(double x); | |
653 long llroundf(float x); | |
654 long llroundl(real x) { return llround(x); } | |
655 | |
656 double trunc(double x); | |
657 float truncf(float x); | |
658 real truncl(real x) { return trunc(x); } | |
659 | |
660 double fmod(double x, double y); | |
661 float fmodf(float x, float y); | |
662 real fmodl(real x, real y) { return fmod(x, y); } | |
663 | |
664 double remainder(double x, double y); | |
665 float remainderf(float x, float y); | |
666 real remainderl(real x, real y) { return remainder(x, y); } | |
667 | |
668 double remquo(double x, double y, int* quo); | |
669 float remquof(float x, float y, int* quo); | |
670 real remquol(real x, real y, int* quo) { return remquo(x, y, quo); } | |
671 | |
672 double copysign(double x, double y); | |
673 float copysignf(float x, float y); | |
674 real copysignl(real x, real y) { return copysign(x, y); } | |
675 | |
676 // double nan(char* tagp); | |
677 // float nanf(char* tagp); | |
678 // real nanl(char* tagp); | |
679 | |
680 double nextafter(double x, double y); | |
681 float nextafterf(float x, float y); | |
682 real nextafterl(real x, real y) { return nextafter(x, y); } | |
683 | |
684 double nexttoward(double x, real y); | |
685 float nexttowardf(float x, real y); | |
686 real nexttowardl(real x, real y) { return nexttoward(x, y); } | |
687 | |
688 double fdim(double x, double y); | |
689 float fdimf(float x, float y); | |
690 real fdiml(real x, real y) { return fdim(x, y); } | |
691 | |
692 double fmax(double x, double y); | |
693 float fmaxf(float x, float y); | |
694 real fmaxl(real x, real y) { return fmax(x, y); } | |
695 | |
696 double fmin(double x, double y); | |
697 float fminf(float x, float y); | |
698 real fminl(real x, real y) { return fmin(x, y); } | |
699 | |
700 double fma(double x, double y, double z); | |
701 float fmaf(float x, float y, float z); | |
702 real fmal(real x, real y, real z) { return fma(x, y, z); } | |
703 } | |
704 else | |
705 { | |
706 double acos(double x); | |
707 float acosf(float x); | |
708 real acosl(real x); | |
709 | |
710 double asin(double x); | |
711 float asinf(float x); | |
712 real asinl(real x); | |
713 | |
714 double atan(double x); | |
715 float atanf(float x); | |
716 real atanl(real x); | |
717 | |
718 double atan2(double y, double x); | |
719 float atan2f(float y, float x); | |
720 real atan2l(real y, real x); | |
721 | |
722 double cos(double x); | |
723 float cosf(float x); | |
724 real cosl(real x); | |
725 | |
726 double sin(double x); | |
727 float sinf(float x); | |
728 real sinl(real x); | |
729 | |
730 double tan(double x); | |
731 float tanf(float x); | |
732 real tanl(real x); | |
733 | |
734 double acosh(double x); | |
735 float acoshf(float x); | |
736 real acoshl(real x); | |
737 | |
738 double asinh(double x); | |
739 float asinhf(float x); | |
740 real asinhl(real x); | |
741 | |
742 double atanh(double x); | |
743 float atanhf(float x); | |
744 real atanhl(real x); | |
745 | |
746 double cosh(double x); | |
747 float coshf(float x); | |
748 real coshl(real x); | |
749 | |
750 double sinh(double x); | |
751 float sinhf(float x); | |
752 real sinhl(real x); | |
753 | |
754 double tanh(double x); | |
755 float tanhf(float x); | |
756 real tanhl(real x); | |
757 | |
758 double exp(double x); | |
759 float expf(float x); | |
760 real expl(real x); | |
761 | |
762 double exp2(double x); | |
763 float exp2f(float x); | |
764 real exp2l(real x); | |
765 | |
766 double expm1(double x); | |
767 float expm1f(float x); | |
768 real expm1l(real x); | |
769 | |
770 double frexp(double value, int* exp); | |
771 float frexpf(float value, int* exp); | |
772 real frexpl(real value, int* exp); | |
773 | |
774 int ilogb(double x); | |
775 int ilogbf(float x); | |
776 int ilogbl(real x); | |
777 | |
778 double ldexp(double x, int exp); | |
779 float ldexpf(float x, int exp); | |
780 real ldexpl(real x, int exp); | |
781 | |
782 double log(double x); | |
783 float logf(float x); | |
784 real logl(real x); | |
785 | |
786 double log10(double x); | |
787 float log10f(float x); | |
788 real log10l(real x); | |
789 | |
790 double log1p(double x); | |
791 float log1pf(float x); | |
792 real log1pl(real x); | |
793 | |
794 double log2(double x); | |
795 float log2f(float x); | |
796 real log2l(real x); | |
797 | |
798 double logb(double x); | |
799 float logbf(float x); | |
800 real logbl(real x); | |
801 | |
802 double modf(double value, double* iptr); | |
803 float modff(float value, float* iptr); | |
804 real modfl(real value, real *iptr); | |
805 | |
806 double scalbn(double x, int n); | |
807 float scalbnf(float x, int n); | |
808 real scalbnl(real x, int n); | |
809 | |
810 double scalbln(double x, c_long n); | |
811 float scalblnf(float x, c_long n); | |
812 real scalblnl(real x, c_long n); | |
813 | |
814 double cbrt(double x); | |
815 float cbrtf(float x); | |
816 real cbrtl(real x); | |
817 | |
818 double fabs(double x); | |
819 float fabsf(float x); | |
820 real fabsl(real x); | |
821 | |
822 double hypot(double x, double y); | |
823 float hypotf(float x, float y); | |
824 real hypotl(real x, real y); | |
825 | |
826 double pow(double x, double y); | |
827 float powf(float x, float y); | |
828 real powl(real x, real y); | |
829 | |
830 double sqrt(double x); | |
831 float sqrtf(float x); | |
832 real sqrtl(real x); | |
833 | |
834 double erf(double x); | |
835 float erff(float x); | |
836 real erfl(real x); | |
837 | |
838 double erfc(double x); | |
839 float erfcf(float x); | |
840 real erfcl(real x); | |
841 | |
842 double lgamma(double x); | |
843 float lgammaf(float x); | |
844 real lgammal(real x); | |
845 | |
846 double tgamma(double x); | |
847 float tgammaf(float x); | |
848 real tgammal(real x); | |
849 | |
850 double ceil(double x); | |
851 float ceilf(float x); | |
852 real ceill(real x); | |
853 | |
854 double floor(double x); | |
855 float floorf(float x); | |
856 real floorl(real x); | |
857 | |
858 double nearbyint(double x); | |
859 float nearbyintf(float x); | |
860 real nearbyintl(real x); | |
861 | |
862 double rint(double x); | |
863 float rintf(float x); | |
864 real rintl(real x); | |
865 | |
866 c_long lrint(double x); | |
867 c_long lrintf(float x); | |
868 c_long lrintl(real x); | |
869 | |
870 long llrint(double x); | |
871 long llrintf(float x); | |
872 long llrintl(real x); | |
873 | |
874 double round(double x); | |
875 float roundf(float x); | |
876 real roundl(real x); | |
877 | |
878 c_long lround(double x); | |
879 c_long lroundf(float x); | |
880 c_long lroundl(real x); | |
881 | |
882 long llround(double x); | |
883 long llroundf(float x); | |
884 long llroundl(real x); | |
885 | |
886 double trunc(double x); | |
887 float truncf(float x); | |
888 real truncl(real x); | |
889 | |
890 double fmod(double x, double y); | |
891 float fmodf(float x, float y); | |
892 real fmodl(real x, real y); | |
893 | |
894 double remainder(double x, double y); | |
895 float remainderf(float x, float y); | |
896 real remainderl(real x, real y); | |
897 | |
898 double remquo(double x, double y, int* quo); | |
899 float remquof(float x, float y, int* quo); | |
900 real remquol(real x, real y, int* quo); | |
901 | |
902 double copysign(double x, double y); | |
903 float copysignf(float x, float y); | |
904 real copysignl(real x, real y); | |
905 | |
906 double nan(char* tagp); | |
907 float nanf(char* tagp); | |
908 real nanl(char* tagp); | |
909 | |
910 double nextafter(double x, double y); | |
911 float nextafterf(float x, float y); | |
912 real nextafterl(real x, real y); | |
913 | |
914 double nexttoward(double x, real y); | |
915 float nexttowardf(float x, real y); | |
916 real nexttowardl(real x, real y); | |
917 | |
918 double fdim(double x, double y); | |
919 float fdimf(float x, float y); | |
920 real fdiml(real x, real y); | |
921 | |
922 double fmax(double x, double y); | |
923 float fmaxf(float x, float y); | |
924 real fmaxl(real x, real y); | |
925 | |
926 double fmin(double x, double y); | |
927 float fminf(float x, float y); | |
928 real fminl(real x, real y); | |
929 | |
930 double fma(double x, double y, double z); | |
931 float fmaf(float x, float y, float z); | |
932 real fmal(real x, real y, real z); | |
933 } |