/* 
    complex - functions and definitions for complex types

    Copyright (C) 1995, Adam Fedor
*/

#ifndef _COMPLEX_INCLUDE_
#define _COMPLEX_INCLUDE_

/* GCC has types for complex, but currently it can't do @encode() on them.
   Anyway multiplication and division don't work (at least in 2.6.3) */
typedef struct _complex_float_ {
    float real, imag;
} complex_float;

typedef struct _complex_double_ {
    double real, imag;
} complex_double;


extern complex_double c_add (complex_double x, complex_double y);
extern complex_double c_sub (complex_double x, complex_double y);
extern complex_double c_mult (complex_double x, complex_double y);
extern complex_double c_div (complex_double x, complex_double y);

extern double c_abs (complex_double z);
extern double c_imag (complex_double z);
extern double c_real (complex_double z);
extern complex_double c_set (double real, double imag);

extern complex_double c_f2d (complex_float f);
extern complex_float  c_d2f (complex_double d);

extern complex_double ccos (complex_double z);
extern complex_double cexp (complex_double z);
extern complex_double clog (complex_double z);
extern complex_double clog10 (complex_double z);
extern complex_double cconj (complex_double z);
extern complex_double cpow (complex_double x, complex_double y);
extern complex_double csin (complex_double z);
extern complex_double csqrt (complex_double z);

extern complex_double	cacos( complex_double __x );
extern complex_double	casin( complex_double __x );
extern complex_double	catan( complex_double __x );
extern complex_double	catan2( complex_double __x, complex_double __y );
extern complex_double	ccosh( complex_double __x );
extern complex_double	cmod( complex_double __x, complex_double __y );
extern complex_double	csinh( complex_double __x );
extern complex_double	ctan( complex_double __x );
extern complex_double	ctanh( complex_double __x );
/* FIXME: would anyone really use these?
extern complex_double	cj0( complex_double __x );
extern complex_double	cj1( complex_double __x );
extern complex_double	cjn( int __n, complex_double __x );
extern complex_double	cy0( complex_double __x );
extern complex_double	cy1( complex_double __x );
extern complex_double	cyn( int __n, complex_double __x );
extern complex_double	cerf( complex_double __x );
extern complex_double	cerfc( complex_double __x );
extern complex_double	cgamma( complex_double __x );
extern complex_double   clgamma( complex_double __x );
*/

#endif /* _COMPLEX_INCLUDE_ */
