2003-10-21 11:43:22 +02:00
|
|
|
/*
|
|
|
|
* complex.h
|
|
|
|
*
|
|
|
|
* This file is part of the Mingw32 package.
|
|
|
|
*
|
|
|
|
* Contributors:
|
|
|
|
* Created by Danny Smith <dannysmith@users.sourceforge.net>
|
|
|
|
*
|
|
|
|
* THIS SOFTWARE IS NOT COPYRIGHTED
|
|
|
|
*
|
|
|
|
* This source code is offered for use in the public domain. You may
|
|
|
|
* use, modify or distribute it freely.
|
|
|
|
*
|
|
|
|
* This code is distributed in the hope that it will be useful but
|
|
|
|
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
|
|
|
|
* DISCLAIMED. This includes but is not limited to warranties of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _COMPLEX_H_
|
|
|
|
#define _COMPLEX_H_
|
|
|
|
|
|
|
|
/* All the headers include this file. */
|
|
|
|
#include <_mingw.h>
|
|
|
|
|
|
|
|
/* These macros are specified by C99 standard */
|
|
|
|
|
|
|
|
#ifndef __cplusplus
|
|
|
|
#define complex _Complex
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#define _Complex_I (0.0F + 1.0iF)
|
|
|
|
|
|
|
|
/* GCC doesn't support _Imaginary type yet, so we don't
|
|
|
|
define _Imaginary_I */
|
|
|
|
|
|
|
|
#define I _Complex_I
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef RC_INVOKED
|
|
|
|
|
2004-08-07 09:58:01 +02:00
|
|
|
double __MINGW_ATTRIB_CONST creal (double _Complex);
|
|
|
|
double __MINGW_ATTRIB_CONST cimag (double _Complex);
|
|
|
|
double __MINGW_ATTRIB_CONST carg (double _Complex);
|
|
|
|
double __MINGW_ATTRIB_CONST cabs (double _Complex);
|
|
|
|
double _Complex __MINGW_ATTRIB_CONST conj (double _Complex);
|
|
|
|
double _Complex cacos (double _Complex);
|
|
|
|
double _Complex casin (double _Complex);
|
|
|
|
double _Complex catan (double _Complex);
|
|
|
|
double _Complex ccos (double _Complex);
|
|
|
|
double _Complex csin (double _Complex);
|
|
|
|
double _Complex ctan (double _Complex);
|
|
|
|
double _Complex cacosh (double _Complex);
|
|
|
|
double _Complex casinh (double _Complex);
|
|
|
|
double _Complex catanh (double _Complex);
|
|
|
|
double _Complex ccosh (double _Complex);
|
|
|
|
double _Complex csinh (double _Complex);
|
|
|
|
double _Complex ctanh (double _Complex);
|
|
|
|
double _Complex cexp (double _Complex);
|
|
|
|
double _Complex clog (double _Complex);
|
|
|
|
double _Complex cpow (double _Complex, double _Complex);
|
|
|
|
double _Complex csqrt (double _Complex);
|
|
|
|
double _Complex __MINGW_ATTRIB_CONST cproj (double _Complex);
|
2003-10-21 11:43:22 +02:00
|
|
|
|
* mingwex/complex/(cabsf.c cacosf.c cacoshf.c cargf.c casinf.c
casinhf.c catanf.c catanhf.c ccosf.c ccoshf.c cexpf.c cimagf.c
clogf.c cpowf.c cprojf.c crealf.c csinf.c csinhf.c csqrtf.c
ctanf.c ctanhf.c): New files.
* mingwex/Makefile.in (COMPLEX_DISTFILES): Adjust.
(COMPLEX_OBJS(: Adjust.
* include/complex.h (cabsf, cacosf, cacoshf, cargf, casinf.
casinhf, catanf, catanhf, ccosf, ccoshf, cexpf, cimagf, clogf,
cpowf, cprojf, crealf, csinf, csinhf, csqrtf, ctanf, ctanhf):
Declare.
2004-12-26 00:56:19 +01:00
|
|
|
float __MINGW_ATTRIB_CONST crealf (float _Complex);
|
|
|
|
float __MINGW_ATTRIB_CONST cimagf (float _Complex);
|
|
|
|
float __MINGW_ATTRIB_CONST cargf (float _Complex);
|
|
|
|
float __MINGW_ATTRIB_CONST cabsf (float _Complex);
|
|
|
|
float _Complex __MINGW_ATTRIB_CONST conjf (float _Complex);
|
|
|
|
float _Complex cacosf (float _Complex);
|
|
|
|
float _Complex casinf (float _Complex);
|
|
|
|
float _Complex catanf (float _Complex);
|
|
|
|
float _Complex ccosf (float _Complex);
|
|
|
|
float _Complex csinf (float _Complex);
|
|
|
|
float _Complex ctanf (float _Complex);
|
|
|
|
float _Complex cacoshf (float _Complex);
|
|
|
|
float _Complex casinhf (float _Complex);
|
|
|
|
float _Complex catanhf (float _Complex);
|
|
|
|
float _Complex ccoshf (float _Complex);
|
|
|
|
float _Complex csinhf (float _Complex);
|
|
|
|
float _Complex ctanhf (float _Complex);
|
|
|
|
float _Complex cexpf (float _Complex);
|
|
|
|
float _Complex clogf (float _Complex);
|
|
|
|
float _Complex cpowf (float _Complex, float _Complex);
|
|
|
|
float _Complex csqrtf (float _Complex);
|
|
|
|
float _Complex __MINGW_ATTRIB_CONST cprojf (float _Complex);
|
|
|
|
|
* mingwex/complex/(cabsl.c cacosl.c cacoshl.c cargl.c casinl.c
casinhl.c catanl.c catanhl.c ccosl.c ccoshl.c cexpl.c cimagl.c
clogl.c cpowl.c cprojl.c creall.c csinl.c csinhl.c csqrtl.c
ctanl.c ctanhl.c): New files.
* mingwex/Makefile.in (COMPLEX_DISTFILES): Adjust.
(COMPLEX_OBJS): Adjust.
* include/complex.h (cabsl, cacosl, cacoshl, cargl, casinf.
casinhl, catanl, catanhl, ccosl, ccoshl, cexpl, cimagl, clogl,
cpowl, cprojl, creall, csinl, csinhl, csqrtl, ctanl, ctanhl):
Declare.
2005-01-10 06:03:55 +01:00
|
|
|
long double __MINGW_ATTRIB_CONST creall (long double _Complex);
|
|
|
|
long double __MINGW_ATTRIB_CONST cimagl (long double _Complex);
|
|
|
|
long double __MINGW_ATTRIB_CONST cargl (long double _Complex);
|
|
|
|
long double __MINGW_ATTRIB_CONST cabsl (long double _Complex);
|
|
|
|
long double _Complex __MINGW_ATTRIB_CONST conjl (long double _Complex);
|
|
|
|
long double _Complex cacosl (long double _Complex);
|
|
|
|
long double _Complex casinl (long double _Complex);
|
|
|
|
long double _Complex catanl (long double _Complex);
|
|
|
|
long double _Complex ccosl (long double _Complex);
|
|
|
|
long double _Complex csinl (long double _Complex);
|
|
|
|
long double _Complex ctanl (long double _Complex);
|
|
|
|
long double _Complex cacoshl (long double _Complex);
|
|
|
|
long double _Complex casinhl (long double _Complex);
|
|
|
|
long double _Complex catanhl (long double _Complex);
|
|
|
|
long double _Complex ccoshl (long double _Complex);
|
|
|
|
long double _Complex csinhl (long double _Complex);
|
|
|
|
long double _Complex ctanhl (long double _Complex);
|
|
|
|
long double _Complex cexpl (long double _Complex);
|
|
|
|
long double _Complex clogl (long double _Complex);
|
|
|
|
long double _Complex cpowl (long double _Complex, long double _Complex);
|
|
|
|
long double _Complex csqrtl (long double _Complex);
|
|
|
|
long double _Complex __MINGW_ATTRIB_CONST cprojl (long double _Complex);
|
|
|
|
|
2003-10-21 11:43:22 +02:00
|
|
|
#ifdef __GNUC__
|
|
|
|
|
* mingwex/complex/(cabsl.c cacosl.c cacoshl.c cargl.c casinl.c
casinhl.c catanl.c catanhl.c ccosl.c ccoshl.c cexpl.c cimagl.c
clogl.c cpowl.c cprojl.c creall.c csinl.c csinhl.c csqrtl.c
ctanl.c ctanhl.c): New files.
* mingwex/Makefile.in (COMPLEX_DISTFILES): Adjust.
(COMPLEX_OBJS): Adjust.
* include/complex.h (cabsl, cacosl, cacoshl, cargl, casinf.
casinhl, catanl, catanhl, ccosl, ccoshl, cexpl, cimagl, clogl,
cpowl, cprojl, creall, csinl, csinhl, csqrtl, ctanl, ctanhl):
Declare.
2005-01-10 06:03:55 +01:00
|
|
|
/* double */
|
2004-08-07 09:58:01 +02:00
|
|
|
__CRT_INLINE double __MINGW_ATTRIB_CONST creal (double _Complex _Z)
|
2003-10-21 11:43:22 +02:00
|
|
|
{
|
|
|
|
return __real__ _Z;
|
|
|
|
}
|
|
|
|
|
2004-08-07 09:58:01 +02:00
|
|
|
__CRT_INLINE double __MINGW_ATTRIB_CONST cimag (double _Complex _Z)
|
2003-10-21 11:43:22 +02:00
|
|
|
{
|
|
|
|
return __imag__ _Z;
|
|
|
|
}
|
|
|
|
|
2004-08-07 09:58:01 +02:00
|
|
|
__CRT_INLINE double _Complex __MINGW_ATTRIB_CONST conj (double _Complex _Z)
|
2003-10-21 11:43:22 +02:00
|
|
|
{
|
|
|
|
return __extension__ ~_Z;
|
|
|
|
}
|
|
|
|
|
2004-08-07 09:58:01 +02:00
|
|
|
__CRT_INLINE double __MINGW_ATTRIB_CONST carg (double _Complex _Z)
|
2003-10-21 11:43:22 +02:00
|
|
|
{
|
|
|
|
double res;
|
|
|
|
__asm__ ("fpatan;"
|
|
|
|
: "=t" (res) : "0" (__real__ _Z), "u" (__imag__ _Z) : "st(1)");
|
|
|
|
return res;
|
|
|
|
}
|
* mingwex/complex/(cabsf.c cacosf.c cacoshf.c cargf.c casinf.c
casinhf.c catanf.c catanhf.c ccosf.c ccoshf.c cexpf.c cimagf.c
clogf.c cpowf.c cprojf.c crealf.c csinf.c csinhf.c csqrtf.c
ctanf.c ctanhf.c): New files.
* mingwex/Makefile.in (COMPLEX_DISTFILES): Adjust.
(COMPLEX_OBJS(: Adjust.
* include/complex.h (cabsf, cacosf, cacoshf, cargf, casinf.
casinhf, catanf, catanhf, ccosf, ccoshf, cexpf, cimagf, clogf,
cpowf, cprojf, crealf, csinf, csinhf, csqrtf, ctanf, ctanhf):
Declare.
2004-12-26 00:56:19 +01:00
|
|
|
|
|
|
|
|
* mingwex/complex/(cabsl.c cacosl.c cacoshl.c cargl.c casinl.c
casinhl.c catanl.c catanhl.c ccosl.c ccoshl.c cexpl.c cimagl.c
clogl.c cpowl.c cprojl.c creall.c csinl.c csinhl.c csqrtl.c
ctanl.c ctanhl.c): New files.
* mingwex/Makefile.in (COMPLEX_DISTFILES): Adjust.
(COMPLEX_OBJS): Adjust.
* include/complex.h (cabsl, cacosl, cacoshl, cargl, casinf.
casinhl, catanl, catanhl, ccosl, ccoshl, cexpl, cimagl, clogl,
cpowl, cprojl, creall, csinl, csinhl, csqrtl, ctanl, ctanhl):
Declare.
2005-01-10 06:03:55 +01:00
|
|
|
/* float */
|
* mingwex/complex/(cabsf.c cacosf.c cacoshf.c cargf.c casinf.c
casinhf.c catanf.c catanhf.c ccosf.c ccoshf.c cexpf.c cimagf.c
clogf.c cpowf.c cprojf.c crealf.c csinf.c csinhf.c csqrtf.c
ctanf.c ctanhf.c): New files.
* mingwex/Makefile.in (COMPLEX_DISTFILES): Adjust.
(COMPLEX_OBJS(: Adjust.
* include/complex.h (cabsf, cacosf, cacoshf, cargf, casinf.
casinhf, catanf, catanhf, ccosf, ccoshf, cexpf, cimagf, clogf,
cpowf, cprojf, crealf, csinf, csinhf, csqrtf, ctanf, ctanhf):
Declare.
2004-12-26 00:56:19 +01:00
|
|
|
__CRT_INLINE float __MINGW_ATTRIB_CONST crealf (float _Complex _Z)
|
|
|
|
{
|
|
|
|
return __real__ _Z;
|
|
|
|
}
|
|
|
|
|
|
|
|
__CRT_INLINE float __MINGW_ATTRIB_CONST cimagf (float _Complex _Z)
|
|
|
|
{
|
|
|
|
return __imag__ _Z;
|
|
|
|
}
|
|
|
|
|
|
|
|
__CRT_INLINE float _Complex __MINGW_ATTRIB_CONST conjf (float _Complex _Z)
|
|
|
|
{
|
|
|
|
return __extension__ ~_Z;
|
|
|
|
}
|
|
|
|
|
|
|
|
__CRT_INLINE float __MINGW_ATTRIB_CONST cargf (float _Complex _Z)
|
|
|
|
{
|
|
|
|
float res;
|
|
|
|
__asm__ ("fpatan;"
|
|
|
|
: "=t" (res) : "0" (__real__ _Z), "u" (__imag__ _Z) : "st(1)");
|
|
|
|
return res;
|
|
|
|
}
|
* mingwex/complex/(cabsl.c cacosl.c cacoshl.c cargl.c casinl.c
casinhl.c catanl.c catanhl.c ccosl.c ccoshl.c cexpl.c cimagl.c
clogl.c cpowl.c cprojl.c creall.c csinl.c csinhl.c csqrtl.c
ctanl.c ctanhl.c): New files.
* mingwex/Makefile.in (COMPLEX_DISTFILES): Adjust.
(COMPLEX_OBJS): Adjust.
* include/complex.h (cabsl, cacosl, cacoshl, cargl, casinf.
casinhl, catanl, catanhl, ccosl, ccoshl, cexpl, cimagl, clogl,
cpowl, cprojl, creall, csinl, csinhl, csqrtl, ctanl, ctanhl):
Declare.
2005-01-10 06:03:55 +01:00
|
|
|
|
|
|
|
/* long double */
|
|
|
|
__CRT_INLINE long double __MINGW_ATTRIB_CONST creall (long double _Complex _Z)
|
|
|
|
{
|
|
|
|
return __real__ _Z;
|
|
|
|
}
|
|
|
|
|
|
|
|
__CRT_INLINE long double __MINGW_ATTRIB_CONST cimagl (long double _Complex _Z)
|
|
|
|
{
|
|
|
|
return __imag__ _Z;
|
|
|
|
}
|
|
|
|
|
|
|
|
__CRT_INLINE long double _Complex __MINGW_ATTRIB_CONST conjl (long double _Complex _Z)
|
|
|
|
{
|
|
|
|
return __extension__ ~_Z;
|
|
|
|
}
|
|
|
|
|
|
|
|
__CRT_INLINE long double __MINGW_ATTRIB_CONST cargl (long double _Complex _Z)
|
|
|
|
{
|
|
|
|
long double res;
|
|
|
|
__asm__ ("fpatan;"
|
|
|
|
: "=t" (res) : "0" (__real__ _Z), "u" (__imag__ _Z) : "st(1)");
|
|
|
|
return res;
|
|
|
|
}
|
|
|
|
|
2003-10-21 11:43:22 +02:00
|
|
|
#endif /* __GNUC__ */
|
|
|
|
|
|
|
|
|
|
|
|
#endif /* RC_INVOKED */
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
#endif /* _COMPLEX_H */
|