Update.
[glibc.git] / math / complex.h
blob72b1e597fca17c27143097b27853fde189bdf2b5
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 #include <features.h>
28 __BEGIN_DECLS
30 /* We might need to add support for more compilers here. But once ISO
31 C 9X is out hopefully all maintained compilers will provide the data
32 types `float complex' and `double complex'. */
33 #if (__GNUC__ == 2 && __GNUC_MINOR__ >= 7) || __GNUC__ > 2
34 # define complex __complex__
35 #endif
38 /* Narrowest imaginary unit. This depends on the floating-point
39 evaluation method.
40 XXX This probably has to go into a gcc related file. */
41 #define _Complex_I (1.0iF)
43 /* Another more descriptive name is `I'.
44 XXX Once we have the imaginary support switch this to _Imaginary_I. */
45 #undef I
46 #define I _Complex_I
49 /* Optimization aids. This is not yet implemented in gcc and once it
50 is this will probably be available in a gcc header. */
51 #define CX_LIMITED_RANGE_ON
52 #define CX_LIMITED_RANGE_OFF
53 #define CX_LIMITED_RANGE_DEFAULT
56 /* The file <bits/cmathcalls.h> contains the prototypes for all the
57 actual math functions. These macros are used for those prototypes,
58 so we can easily declare each function as both `name' and `__name',
59 and can declare the float versions `namef' and `__namef'. */
61 #define __MATHCALL(function, args) \
62 __MATHDECL (_Mdouble_complex_,function, args)
63 #define __MATHDECL(type, function, args) \
64 __MATHDECL_1(type, function, args); \
65 __MATHDECL_1(type, __CONCAT(__,function), args)
66 #define __MATHDECL_1(type, function, args) \
67 extern type __MATH_PRECNAME(function) args
69 #define _Mdouble_ double
70 #define __MATH_PRECNAME(name) name
71 #include <bits/cmathcalls.h>
72 #undef _Mdouble_
73 #undef __MATH_PRECNAME
75 /* Now the float versions. */
76 #ifndef _Mfloat_
77 #define _Mfloat_ float
78 #endif
79 #define _Mdouble_ _Mfloat_
80 #ifdef __STDC__
81 #define __MATH_PRECNAME(name) name##f
82 #else
83 #define __MATH_PRECNAME(name) name/**/f
84 #endif
85 #include <bits/cmathcalls.h>
86 #undef _Mdouble_
87 #undef __MATH_PRECNAME
89 /* And the long double versions. It is non-critical to define them
90 here unconditionally since `long double' is required in ISO C 9X. */
91 #ifndef _Mlong_double_
92 #define _Mlong_double_ long double
93 #endif
94 #define _Mdouble_ _Mlong_double_
95 #ifdef __STDC__
96 #define __MATH_PRECNAME(name) name##l
97 #else
98 #define __MATH_PRECNAME(name) name/**/l
99 #endif
100 #include <bits/cmathcalls.h>
101 #undef _Mdouble_
102 #undef __MATH_PRECNAME
103 #undef __MATHDECL_1
104 #undef __MATHDECL
105 #undef __MATHCALL
107 __END_DECLS
109 #endif /* complex.h */