Update.
[glibc.git] / math / complex.h
blob6fc5c1975f951e3a7e61f43e3cb0bbb32a50b829
1 /* Copyright (C) 1997 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.
4 The GNU C Library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public License as
6 published by the Free Software Foundation; either version 2 of the
7 License, or (at your option) any later version.
9 The GNU C Library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
14 You should have received a copy of the GNU Library General Public
15 License along with the GNU C Library; see the file COPYING.LIB. If not,
16 write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 Boston, MA 02111-1307, USA. */
20 * ISO C 9X: 7.8 Complex arithmetic <complex.h>
23 #ifndef _COMPLEX_H
24 #define _COMPLEX_H 1
26 /* We might need to add support for more compilers here. But once ISO
27 C 9X is out hopefully all maintained compilers will provide the data
28 types `float complex' and `double complex'. */
29 #if (__GNUC__ == 2 && __GNUC_MINOR__ >= 7) || __GNUC__ > 2
30 # define complex __complex__
31 #endif
34 /* Narrowest imaginary unit. This depends on the floating-point
35 evaluation method.
36 XXX This probably has to go into a gcc related file. */
37 #define _Imaginary_I (DBL_EPSISON * 1.0i)
39 /* Another more descriptive name is `I'. */
40 #undef I
41 #define I _Imaginary_I
44 /* Optimization aids. This is not yet implemented in gcc and yonce it
45 is this will probably be available in a gcc header. */
46 #define CX_LIMITED_RANGE_ON
47 #define CX_LIMITED_RANGE_OFF
48 #define CX_LIMITED_RANGE_DEFAULT
51 /* The file <cmathcalls.h> contains the prototypes for all the actual
52 math functions. These macros are used for those prototypes, so
53 we can easily declare each function as both `name' and `__name',
54 and can declare the float versions `namef' and `__namef'. */
56 #define __MATHCALL(function, args) \
57 __MATHDECL (_Mdouble_complex_,function, args)
58 #define __MATHDECL(type, function, args) \
59 __MATHDECL_1(type, function, args); \
60 __MATHDECL_1(type, __CONCAT(__,function), args)
61 #define __MATHDECL_1(type, function, args) \
62 extern type __MATH_PRECNAME(function) args
64 #define _Mdouble_ double
65 #define __MATH_PRECNAME(name) name
66 #include <cmathcalls.h>
67 #undef _Mdouble_
68 #undef __MATH_PRECNAME
70 /* Now the float versions. */
71 #ifndef _Mfloat_
72 #define _Mfloat_ float
73 #endif
74 #define _Mdouble_ _Mfloat_
75 #ifdef __STDC__
76 #define __MATH_PRECNAME(name) name##f
77 #else
78 #define __MATH_PRECNAME(name) name/**/f
79 #endif
80 #include <cmathcalls.h>
81 #undef _Mdouble_
82 #undef __MATH_PRECNAME
84 /* And the long double versions. It is non-critical to define them
85 here unconditionally since `long double' is required in ISO C 9X. */
86 #ifndef _Mlong_double_
87 #define _Mlong_double_ long double
88 #endif
89 #define _Mdouble_ _Mlong_double_
90 #ifdef __STDC__
91 #define __MATH_PRECNAME(name) name##l
92 #else
93 #define __MATH_PRECNAME(name) name/**/l
94 #endif
95 #include <cmathcalls.h>
96 #undef _Mdouble_
97 #undef __MATH_PRECNAME
98 #undef __MATHDECL_1
99 #undef __MATHDECL
100 #undef __MATHCALL
102 #endif /* complex.h */