51bdf2ca90b3ebd1d642796ecc8a330a217ede93
4 * Mathematical functions.
6 * This file is part of the Mingw32 package.
9 * Created by Colin Peters <colin@bird.fu.is.saga-u.ac.jp>
11 * THIS SOFTWARE IS NOT COPYRIGHTED
13 * This source code is offered for use in the public domain. You may
14 * use, modify or distribute it freely.
16 * This code is distributed in the hope that it will be useful but
17 * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
18 * DISCLAMED. This includes but is not limited to warranties of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
23 * $Date: 2002/09/08 10:22:31 $
36 * HUGE_VAL is returned by strtod when the value would overflow the
37 * representation of 'double'. There are other uses as well.
39 * __imp__HUGE is a pointer to the actual variable _HUGE in
40 * MSVCRT.DLL. If we used _HUGE directly we would get a pointer
41 * to a thunk function.
43 * NOTE: The CRTDLL version uses _HUGE_dll instead.
46 extern double* __imp__HUGE
;
47 #define HUGE_VAL (*__imp__HUGE)
50 extern double* _HUGE_dll
;
51 #define HUGE_VAL (*_HUGE_dll)
65 * Types for the above _exception structure.
68 #define _DOMAIN 1 /* domain error in argument */
69 #define _SING 2 /* singularity */
70 #define _OVERFLOW 3 /* range overflow */
71 #define _UNDERFLOW 4 /* range underflow */
72 #define _TLOSS 5 /* total loss of precision */
73 #define _PLOSS 6 /* partial loss of precision */
76 * Exception types with non-ANSI names for compatibility.
79 #ifndef __STRICT_ANSI__
82 #define DOMAIN _DOMAIN
84 #define OVERFLOW _OVERFLOW
85 #define UNDERFLOW _UNDERFLOW
89 #endif /* Not _NO_OLDNAMES */
90 #endif /* Not __STRICT_ANSI__ */
93 double sin (double x
);
94 double cos (double x
);
95 double tan (double x
);
96 double sinh (double x
);
97 double cosh (double x
);
98 double tanh (double x
);
99 double asin (double x
);
100 double acos (double x
);
101 double atan (double x
);
102 double atan2 (double y
, double x
);
103 double exp (double x
);
104 double log (double x
);
105 double log10 (double x
);
106 double pow (double x
, double y
);
107 long double powl (long double x
,long double y
);
108 double sqrt (double x
);
109 double ceil (double x
);
110 double floor (double x
);
111 double fabs (double x
);
112 double ldexp (double x
, int n
);
113 double frexp (double x
, int* exp
);
114 double modf (double x
, double* ip
);
115 long double modfl (long double x
,long double* ip
);
116 double fmod (double x
, double y
);
119 #ifndef __STRICT_ANSI__
121 /* Complex number (for cabs) */
124 double x
; /* Real part */
125 double y
; /* Imaginary part */
128 double _cabs (struct _complex x
);
129 double _hypot (double x
, double y
);
130 double _j0 (double x
);
131 double _j1 (double x
);
132 double _jn (int n
, double x
);
133 double _y0 (double x
);
134 double _y1 (double x
);
135 double _yn (int n
, double x
);
140 * Non-underscored versions of non-ANSI functions. These reside in
141 * liboldnames.a. Provided for extra portability.
143 double cabs (struct _complex x
);
144 double hypot (double x
, double y
);
145 double j0 (double x
);
146 double j1 (double x
);
147 double jn (int n
, double x
);
148 double y0 (double x
);
149 double y1 (double x
);
150 double yn (int n
, double x
);
152 #endif /* Not _NO_OLDNAMES */
154 #endif /* Not __STRICT_ANSI__ */
160 #endif /* Not _MATH_H_ */