3 extern void sig_die (char *, int);
5 c_div (complex * c
, complex * a
, complex * b
)
10 if ((abr
= b
->r
) < 0.)
12 if ((abi
= b
->i
) < 0.)
18 #ifdef IEEE_COMPLEX_DIVIDE
21 if (a
->i
!= 0 || a
->r
!= 0)
23 c
->i
= c
->r
= af
/ bf
;
26 sig_die ("complex division by zero", 1);
29 ratio
= (double) b
->r
/ b
->i
;
30 den
= b
->i
* (1 + ratio
* ratio
);
31 cr
= (a
->r
* ratio
+ a
->i
) / den
;
32 c
->i
= (a
->i
* ratio
- a
->r
) / den
;
37 ratio
= (double) b
->i
/ b
->r
;
38 den
= b
->r
* (1 + ratio
* ratio
);
39 cr
= (a
->r
+ a
->i
* ratio
) / den
;
40 c
->i
= (a
->i
- a
->r
* ratio
) / den
;