Split the MSVCRT implementation headers from the public headers.
[wine] / include / msvcrt / math.h
1 /*
2  * Math functions.
3  *
4  * Derived from the mingw header written by Colin Peters.
5  * Modified for Wine use by Hans Leidekker.
6  * This file is in the public domain.
7  */
8
9 #ifndef __WINE_MATH_H
10 #define __WINE_MATH_H
11 #ifndef __WINE_USE_MSVCRT
12 #define __WINE_USE_MSVCRT
13 #endif
14
15 #ifdef __cplusplus
16 extern "C" {
17 #endif
18
19 #define _DOMAIN         1       /* domain error in argument */
20 #define _SING           2       /* singularity */
21 #define _OVERFLOW       3       /* range overflow */
22 #define _UNDERFLOW      4       /* range underflow */
23 #define _TLOSS          5       /* total loss of precision */
24 #define _PLOSS          6       /* partial loss of precision */
25
26 #ifndef _EXCEPTION_DEFINED
27 #define _EXCEPTION_DEFINED
28 struct _exception
29 {
30   int     type;
31   char    *name;
32   double  arg1;
33   double  arg2;
34   double  retval;
35 };
36 #endif /* _EXCEPTION_DEFINED */
37
38 #ifndef _COMPLEX_DEFINED
39 #define _COMPLEX_DEFINED
40 struct _complex
41 {
42   double x;      /* Real part */
43   double y;      /* Imaginary part */
44 };
45 #endif /* _COMPLEX_DEFINED */
46
47 double sin(double);
48 double cos(double);
49 double tan(double);
50 double sinh(double);
51 double cosh(double);
52 double tanh(double);
53 double asin(double);
54 double acos(double);
55 double atan(double);
56 double atan2(double, double);
57 double exp(double);
58 double log(double);
59 double log10(double);
60 double pow(double, double);
61 double sqrt(double);
62 double ceil(double);
63 double floor(double);
64 double fabs(double);
65 double ldexp(double, int);
66 double frexp(double, int*);
67 double modf(double, double*);
68 double fmod(double, double);
69
70 double hypot(double, double);
71 double j0(double);
72 double j1(double);
73 double jn(int, double);
74 double y0(double);
75 double y1(double);
76 double yn(int, double);
77
78 int _matherr(struct _exception*);
79 double _cabs(struct _complex);
80
81 #ifndef HUGE_VAL
82 #  if defined(__GNUC__) && (__GNUC__ >= 3)
83 #    define HUGE_VAL    (__extension__ 0x1.0p2047)
84 #  else
85 static const union {
86     unsigned char __c[8];
87     double __d;
88 } __huge_val = { { 0, 0, 0, 0, 0, 0, 0xf0, 0x7f } };
89 #    define HUGE_VAL    (__huge_val.__d)
90 #  endif
91 #endif
92
93 #ifdef __cplusplus
94 }
95 #endif
96
97 #endif /* __WINE_MATH_H */