-
Notifications
You must be signed in to change notification settings - Fork 119
/
complex.h
36 lines (29 loc) · 814 Bytes
/
complex.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#ifndef _NR_COMPLEX_H_
#define _NR_COMPLEX_H_
#ifndef _FCOMPLEX_DECLARE_T_
typedef struct FCOMPLEX {float r,i;} fcomplex;
#define _FCOMPLEX_DECLARE_T_
#endif /* _FCOMPLEX_DECLARE_T_ */
#if defined(__STDC__) || defined(ANSI) || defined(NRANSI) /* ANSI */
fcomplex Cadd(fcomplex a, fcomplex b);
fcomplex Csub(fcomplex a, fcomplex b);
fcomplex Cmul(fcomplex a, fcomplex b);
fcomplex Complex(float re, float im);
fcomplex Conjg(fcomplex z);
fcomplex Cdiv(fcomplex a, fcomplex b);
float Cabs(fcomplex z);
fcomplex Csqrt(fcomplex z);
fcomplex RCmul(float x, fcomplex a);
#else /* ANSI */
/* traditional - K&R */
fcomplex Cadd();
fcomplex Csub();
fcomplex Cmul();
fcomplex Complex();
fcomplex Conjg();
fcomplex Cdiv();
float Cabs();
fcomplex Csqrt();
fcomplex RCmul();
#endif /* ANSI */
#endif /* _NR_COMPLEX_H_ */