math.h 2.3 KB
Newer Older
1 2 3 4 5 6 7 8
/*
 * Math functions.
 *
 * Derived from the mingw header written by Colin Peters.
 * Modified for Wine use by Hans Leidekker.
 * This file is in the public domain.
 */

9 10
#ifndef __WINE_MATH_H
#define __WINE_MATH_H
11 12

#include <crtdefs.h>
13

14 15
#include <pshpack8.h>

16 17 18 19
#ifdef __cplusplus
extern "C" {
#endif

20 21 22 23 24 25 26
#define _DOMAIN         1       /* domain error in argument */
#define _SING           2       /* singularity */
#define _OVERFLOW       3       /* range overflow */
#define _UNDERFLOW      4       /* range underflow */
#define _TLOSS          5       /* total loss of precision */
#define _PLOSS          6       /* partial loss of precision */

27 28 29
#ifndef _EXCEPTION_DEFINED
#define _EXCEPTION_DEFINED
struct _exception
30 31 32 33 34 35 36
{
  int     type;
  char    *name;
  double  arg1;
  double  arg2;
  double  retval;
};
37
#endif /* _EXCEPTION_DEFINED */
38

39 40 41
#ifndef _COMPLEX_DEFINED
#define _COMPLEX_DEFINED
struct _complex
42 43 44 45
{
  double x;      /* Real part */
  double y;      /* Imaginary part */
};
46
#endif /* _COMPLEX_DEFINED */
47

48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69
double __cdecl sin(double);
double __cdecl cos(double);
double __cdecl tan(double);
double __cdecl sinh(double);
double __cdecl cosh(double);
double __cdecl tanh(double);
double __cdecl asin(double);
double __cdecl acos(double);
double __cdecl atan(double);
double __cdecl atan2(double, double);
double __cdecl exp(double);
double __cdecl log(double);
double __cdecl log10(double);
double __cdecl pow(double, double);
double __cdecl sqrt(double);
double __cdecl ceil(double);
double __cdecl floor(double);
double __cdecl fabs(double);
double __cdecl ldexp(double, int);
double __cdecl frexp(double, int*);
double __cdecl modf(double, double*);
double __cdecl fmod(double, double);
70

71 72 73 74 75 76 77
double __cdecl hypot(double, double);
double __cdecl j0(double);
double __cdecl j1(double);
double __cdecl jn(int, double);
double __cdecl y0(double);
double __cdecl y1(double);
double __cdecl yn(int, double);
78

79 80
int __cdecl _matherr(struct _exception*);
double __cdecl _cabs(struct _complex);
81

82 83 84 85 86 87 88 89 90 91 92 93
#ifndef HUGE_VAL
#  if defined(__GNUC__) && (__GNUC__ >= 3)
#    define HUGE_VAL    (__extension__ 0x1.0p2047)
#  else
static const union {
    unsigned char __c[8];
    double __d;
} __huge_val = { { 0, 0, 0, 0, 0, 0, 0xf0, 0x7f } };
#    define HUGE_VAL    (__huge_val.__d)
#  endif
#endif

94 95 96 97
#ifdef __cplusplus
}
#endif

98 99
#include <poppack.h>

100
#endif /* __WINE_MATH_H */